-
-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show all histograms of an Overlay #5031
Show all histograms of an Overlay #5031
Conversation
I think I still have to write/update some tests related to this. However, I couldn't find a contributor's guide on the Holoviews website that explains the Holoviews testing frameworks and principles. Can anyone provide me a reference to how to write and run tests for Holoviews? |
Comparison of new vs old behavior for the regular import numpy as np
import holoviews as hv
hv.extension('bokeh')
pts1 = hv.Points(np.random.randn(1000, 2) , kdims=['x', 'y'], label='p1l')
pts2 = hv.Points(np.random.randn(1000, 2) - 5, kdims=['x', 'y'], label='p2l')
pts_overlay = pts1 * pts2
plot = pts_overlay.hist(dimension=['x','y'])
print(repr(plot))
plot I also have a notebook that illustrates in more depth some of the features of this PR: https://gist.github.com/peterroelants/32fadcdf4d27ff6228178fa9a8a2252b#file-overlay_hists-ipynb You have to run the notebook yourself on this branch to see the effects (GitHub Gists crashed each time when I tried to upload the notebook with embedded Holoviews/Bokeh plots) EDIT: Update figure after updating PR |
Some things to be considered:
|
I'm traveling and only have my phone, but from the pictures it looks like a big improvement to me! Maybe @jlstevens or @philippjfr will be able to take a look sooner. |
One comment: it might be good to suppress the legend for the histogram, because it's redundant for an AdjointLayout and typically overlaps the bars a lot. ETA: now your own comment shows up on my phone saying the same thing about the legends; yes, I do think they should be suppressed by default. I don't have an answer for the colormap question. Sorry for the confusing reply! |
8c3d0c7
to
753d609
Compare
@jbednar I updated this to hide the legend in the histograms by default, and added a parameter to still enable them if needed. I also made sure that axes are aligned in the case of One weird thing that I cant explain is that the histogram plot sizes of Overlays are different compared to the histograms of plain elements. E.g.: vsPlease take your time while travelling. I'm not in a rush to get this in. |
I think this is a sensible change but since it's a change in behavior would go into 2.0. |
@philippjfr Should I file a PR against a different branch? Or leave this as-it-is for now? |
You're good, master is already in "2.0" mode, e.g. a bunch of deprecations for 2.0 have already happened. |
Thanks for the PR! This change seems appropriate to me and as already mentioned this is a good time to allow backwards incompatible behavior. I've not yet checked what unit tests are running here but I would want some tests that make sure |
Looks great to me! @jlstevens , can you see how to avoid having the size change like that? The smaller size (equivalent to adding .opts(width=120) (or so) if I recall correctly) seems much more appropriate for an adjoint histogram, but I don't know why the size is changing when it's an overlay. |
753d609
to
249313a
Compare
@jlstevens I rebased this PR on latest master, and most tests seem to be passing. The ones that fail seem to fail due to unrelated reasons: All of them are Python 3.6 tests |
I would love to get this merged in at some point. Is there anything that I can do on my side to get this approved and merged? |
Sorry for letting this languish! I agree that those test failures are unrelated. I will now approve this PR (looks fine to me) but I will wait a bit to give @philippjfr to also have a look. I'll merge at the end of the day regardless. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
I don't think we need to worry about backwards compatibility as it will end up on the 2.0 branch. The only thing that would be nice to add would be some additional unit tests...
Actually, there is the size issue that @jbednar mentions. I'll have a look now... |
The sizing issue is unrelated to this PR: the problem is about how overlays become adjoint which is a separate problem. @peterroelants Can you have a look at the issues and report this if it hasn't been already? At which point I am happy to merge. |
@jlstevens I couldn't find an existing issue related to the adjoint overlays resulting in an unexpected plot size. I created a issue for it at #5072 |
Thanks! I'm going to go ahead and merge. That way we can test and iron out any other issues before the 2.0 release. |
I created a PR to enable showing all histograms of an Overlay:
This PR:
NdOverlay.hist raises AttributeError
: NdOverlay.hist raises AttributeError #5022 .NdOverlay.hist
works in this PR.CompositeOverlay.hist()
shows histograms for all the elements in the overlay. This affects bothNdOverlay
andOverlay
(e.g. see previous comment @ NdOverlay.hist raises AttributeError #5022 (comment))Illustration of new
CompositeOverlay.hist()
behavior. Notice the histograms being overlaid for both elements in the overlay:I would love to get some feedback on this PR