holoviz / holoviews

With Holoviews, your data visualizes itself.
https://holoviews.org
BSD 3-Clause "New" or "Revised" License
2.7k stars 402 forks source link

Allow any plot as adjoints #358

Closed jbednar closed 7 years ago

jbednar commented 8 years ago

Currently, histograms (and some other types of plots?) can be used as adjoints in layouts, as in the home page example:

holohome

But often we want to plot some quantity that has a relationship to the x or y axis of the main plot, and it would be nice to be able to put whatever that plot is in the same position that the histogram fills. E.g. in the home page example, the slice would actually make sense as an adjoint along the top, since it's a slice along that axis:

holohome2

Is this feasible? It would make for much more effective layouts in some cases, allowing the main plot to be large while still allowing space for the adjoint plots.

jbednar commented 8 years ago

Alternatively, eventually we really need to have more control over the layout in general, e..g. to make some plots take twice the width of others (so that here the main plot could be big with the two other plots side by side below or above it). But supporting any plot as an adjoint seems more feasible in the short term.

philippjfr commented 8 years ago

The main obstacle to that is to make sure that all plot types support inverting the axes. Should be fairly straightforward but will take some time.

jbednar commented 8 years ago

What would be the syntax? Something like

((fractal * HLine(y=0)).hist().adjoin(fractal.sample(y=0)))

?

philippjfr commented 8 years ago

Currently it's:

(fractal * HLine(y=0)).hist()) << fractal.sample(y=0)
jbednar commented 8 years ago

Thanks. Currently that gives a fairly unhelpful "KeyError" and no other output.

jlstevens commented 8 years ago

We introduce the << operator because we wanted the adjoint plots to be general (i.e what this issue is asking for). That operator is so rarely used right now, I would like to either see it either go away or get used more often!

Given that removing the operator would require a new method (e.g adjoin above), I would hope resolving this issue will mean << gets used more.

philippjfr commented 8 years ago

This also reminds me that we don't have a way to style adjoined plots separately from normal plots, so we can't expose any additional plot or style options an adjoined plot adds. Thought we had an issue about that but can't find it right now.

vascotenner commented 7 years ago

Furthermore, AdjointLayouts are not in the tutorials yet. hv.help(hv.AdjointLayout) points to something like: http://holoviews.org/Tutorials/Containers.html#AdjointLayout

philippjfr commented 7 years ago

Furthermore, AdjointLayouts are not in the tutorials yet. hv.help(hv.AdjointLayout) points to something like: http://holoviews.org/Tutorials/Containers.html#AdjointLayout

Good point, we had originally considered deprecating them, but they are useful so we should definitely document them.

github-actions[bot] commented 6 days ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.