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

Apply scalebar length to subcoordinate_y range #6420

Merged
merged 1 commit into from
Oct 22, 2024
Merged

Conversation

droumis
Copy link
Member

@droumis droumis commented Oct 22, 2024

Fixes #6416

Enabling subcoordinate_y should now apply the scalebar length relative to the subcoordinate_y range.

Code
import holoviews as hv
import numpy as np
import panel as pn
pn.extension()
hv.extension("bokeh")


common_opts = dict(subcoordinate_y=True, scalebar_unit=("cm", "m"), color="lightgrey")

curves = []
for i in range(10):
    curves.append(hv.Curve(np.random.rand(1000), label=f'c{i}').opts(**common_opts, scalebar=True if i == 5 else False))

curves = hv.Overlay(curves).opts(show_legend=False)

pn.panel(curves.opts(width=800, height=600)).servable()
image

@droumis droumis requested a review from hoxbro October 22, 2024 15:00
@hoxbro hoxbro added the type: enhancement Minor feature or improvement to an existing feature label Oct 22, 2024
@hoxbro hoxbro enabled auto-merge (squash) October 22, 2024 15:06
@hoxbro hoxbro merged commit 2e4979b into main Oct 22, 2024
14 of 16 checks passed
@hoxbro hoxbro deleted the scalebar_defaults branch October 22, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready type: enhancement Minor feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ScaleBar on subcoordinate_y is overflowing subcoordinate range
2 participants