Skip to content
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

Nested legend #2755

Merged
merged 3 commits into from Jun 4, 2018
Merged

Nested legend #2755

merged 3 commits into from Jun 4, 2018

Conversation

@philippjfr
Copy link
Member

@philippjfr philippjfr commented Jun 1, 2018

This PR ensures that nested Nd(Overlays) generate a legend. Previously nesting Overlays inside an NdOverlay would mean two things:

  1. The styling group_counter would be reset inside the nested OverlayPlot meaning that color cycles would not work.
  2. The topmost legend plot would not find matplotlib artists nested further down and the bokeh version would not pass its dimensions down to the individual elementplots meaning that no legend would be generated.
%%opts Spread (alpha=0.1) Path [show_legend=True]

d = {}
for i in range(1, 5):
    xs = np.linspace(0, 1)
    ys = xs**2 / i + 5 * i
    d[i] = hv.Path((xs, ys), kdims=['X', 'Y']) * hv.Spread((xs, ys, 2))
hv.NdOverlay(d)

screen shot 2018-06-01 at 1 27 20 pm

image

@jbednar
jbednar approved these changes Jun 1, 2018
Copy link
Member

@jbednar jbednar left a comment

Looks great!

@philippjfr philippjfr force-pushed the nested_legend branch from d62b002 to 80c81bd Jun 1, 2018
@jlstevens
Copy link
Contributor

@jlstevens jlstevens commented Jun 1, 2018

Looks good to me as well. Happy to merge once the tests are green.

@philippjfr
Copy link
Member Author

@philippjfr philippjfr commented Jun 4, 2018

Ready to merge now.

@jlstevens jlstevens merged commit 11b1389 into master Jun 4, 2018
4 checks passed
4 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.002%) to 82.834%
Details
@philippjfr
s3-reference-data-cache Tests passing no test data changes required.
Details
@philippjfr philippjfr deleted the nested_legend branch Jul 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants