Open mrksr opened 8 years ago
Thanks @mrksr, I'll have a look at this today. Should be a straightforward fix.
Sorry @mrksr, I was wrong before. This is an actual restriction of our current layout system, but the error message is obviously confusing. Currently NdLayouts cannot be nested inside Layouts and vice versa. It should be possible to simply concatenate them all into a big layout, and I'll target that for a v1.5 release. Actually nesting Layouts to achieve more complex plot arrangements is also on our roadmap but probably won't happen in the near future.
Until either of those happen NdLayouts are restricted to displaying collections of Elements or Overlays, which are uniform in type and can't be used inside another Layout. For now I'll catch this a bit earlier and provide a better exception.
I see. Is there a way to achieve these tree-like arrangements of plots through other means? By this I mean to have a plot which is the same size as a collection of other plots, something like this (in pseudo code):
bigplot + (smallplot + smallplot + smallplot + smallplot).cols(2)
Or is this what you mean by "nesting Layouts to achieve more complex plot arrangements"? If so then I'm looking forward to seeing that :). If I have some free time over the holidays I can also try working on this if it is not too hard.
For this purpose, we sometimes resort to abusing GridSpace
to hold the smaller plots. It isn't quite the same as an NdLayout
but it can be made to work. The real solution is the proposal to implement the nested Layout proposal though...
Or is this what you mean by "nesting Layouts to achieve more complex plot arrangements"? If so then I'm looking forward to seeing that :).
That is what I mean by more complex plot arrangements yes, currently everything is forced into a regular grid with the only exception being that GridSpaces may be nested in a Layout. You can see some of our previous discussion on the topic here: https://github.com/ioam/holoviews/issues/91.
If I have some free time over the holidays I can also try working on this if it is not too hard.
The Layout code is some of the hairiest code in all of HoloViews so I wouldn't want to inflict that on you. I think with the release of matplotlib 2.0 we'll start work on a major refactor of our matplotlib backend, which may also be a good opportunity to redesign the layout system.
Thanks for the tip, @jlstevens! I thought about doing this, but I was not quite sure as to how to get the two columns in the Grid Space. In the example above, there is only one key dimension (the "number" of the plot). Is there a way of "spreading" this over two dimensions?
Thank you for the insight, @philippjfr. :)
The following code creates a HoloMap containing four Curve objects. These Curves should be displayed next to a fifth Curve object using an Ndlayout.
This gives the following TypeError when executed in a notebook with the notebook_extension enabled:
I am using the most recent Anaconda3 python distribution with Python 3.5 and tired both v1.4.0 and the current master branch of holoviews.