-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
Spikes element does not overlay properly #1539
Comments
Actually, this issue may be a duplicate of the issue described in #1480. |
Looks like it is fixed? This screenshot shows a different issue (unexpected colormapping) described in #1669. |
I'm not sure this was ever a real issue, it's just to do with the semantics of Spikes. By default |
Philipp and I discussed this about maybe the height plot options should be 1 by default as a relative quantity (fraction of the y-axis). That would make more sense to me I think. |
@jlstevens I agree. I just learned that import numpy as np
import holoviews as hv
hv.extension("bokeh")
x = np.linspace(0, 1)
curve = hv.Curve((x, np.sin(x)), label="sin(x)")
height = curve.data["y"].max() - curve.data["y"].min()
spikes = hv.Spikes(([0.5], [height]), vdims="height", label="mid")
spikes * curve # need to make sure the colors are the same for spikes/vlines
# would look a bit better if I adjusted the spike thickness too
spikes = hv.Spikes([0.5], label="mid").opts(color="black")
vline = hv.VLine(0.5).opts(color="black")
spikes * curve * vline |
Is there already something like relative spike_length, so you don't have to think yourself about what absolute length the spikes should get? |
@philippjfr I'm wondering if there is a way to use the |
I'm not sure if spike_length=np.ptp(dim('y'))/10. |
Actually no that doesn't make sense, that would just get the range of the y-values, not the overall range of the plot. |
As shown here:
I get the same issue with matplotlib.
The text was updated successfully, but these errors were encountered: