koaning/whatlies

Add support for customizing axis label as well as title of the plots

Closed this issue · 14 comments

mkaze commented

Currently, the user cannot customize the axis label and the title of a plot. It's good if we could provide a built-in support for this.

Thanks for the issue, @JustinaPetr will get back to you about it soon!

You may find help in the docs and the forum, too 🤗

With the advent of features like #129 I wonder what the best approach is here. One concern I have is that the plot method might get "super full of variables". Especially if we're also considering another backend like Bokeh.

Might it be enough to document how to work with Altair? Something like;

(lang[text]
  .transform(Umap(2))
  .plot_interactive("umap_0", "umap_1", annot=False)
  .properties(title="spaCy", height=200, width=200))

If possible, I'd prefer to relay customisation of the plots to the user. The feature list of customisation options can get really big.

mkaze commented

If possible, I'd prefer to relay customisation of the plots to the user. The feature list of customisation options can get really big.

All right, agreed If you think that's a lot to offer and might not noticeably make the user life easier; although, personally, when I see a method with lots of arguments I cheer up because it gives more freedom to do various things in a builtin-way and without me to take care of it implementation. On the other hand, that's also a fair point to consider the current stage and scope of the library.

For this issue then we'd consider an addition to the documentation to also be a valid solution?

mkaze commented

For this issue then we'd consider an addition to the documentation to also be a valid solution?

Yeah, if the plan is to not support these. We can add a note or an example to the documentation or FAQ section for further configuring the plots.

I'll make a PR that adds this to the FAQ. That should help.

I've made a PR here #136 but it seems like renaming the axes is not supported via .properties. This is making me wonder if we do need to add it as a feature. I can certainly see people wanting to customise the axes.

I've stumbled across a related issue.

image

If we apply operations on embeddings then the name updates. Unfortunately this makes certain interactive charts verbose. It'd be nice if there was an easier way to deal with this. We could change the standard that we won't take the name of an Embedding but rather the orig property. But maybe there's something more elegant that we can do with plot settings.

mkaze commented

This is making me wonder if we do need to add it as a feature. I can certainly see people wanting to customise the axes.

I also have the same thought. For example, for EmebeddingSet.plot when x_axis and y_axis are string values, they are used to fetch projection embedding (for 3D+ embedding case). But there is a conflict for 2D case: should they be used for label of axis or fetching embedding? That's one more reason that we should also provide x_label and y_label argument for plot methods and completely separate them from x_axis and y_axis arguments (of course, e.g. if x_axis is an Embedding and x_label is not provided we use the name of embedding for label; though, the preference is always given to x_label if set).

mkaze commented

@koaning This was implemented for matlplotlib plots, i.e. plot method. After all the discussion here, is the final decision to implement it for Altair plots as well, or should this issue be closed?

I saw you've already made the PR but I'd say this is indeed also valid for Altair.

@mkaze I think this issue can be closed. Just to check, agree?

mkaze commented

@mkaze I think this issue can be closed. Just to check, agree?

Actually, a few days ago, I was thinking whether other plot methods like plot_interactive_matrix should support these or not. So, I am not sure.

I'm closing issues because ever since the project moved to my personal account it's been more into maintenance mode than a "active work" mode.