Is there a parameter that controls/removes the tips/end bars from ErrorBars?
errors = [(0.1*i, np.sin(0.1*i), np.random.rand()/2, np.random.rand()/4) for i in np.linspace(0, 100, 11)]
hv.Curve(errors) * hv.ErrorBars(errors, vdims=['y', 'yerrneg', 'yerrpos'])
1 Like
The options are upper_head
and lower_head
:
errors = [(0.1*i, np.sin(0.1*i), np.random.rand()/2, np.random.rand()/4) for i in np.linspace(0, 100, 11)]
hv.Curve(errors) * hv.ErrorBars(errors, vdims=['y', 'yerrneg', 'yerrpos']).opts(upper_head=None, lower_head=None)
1 Like
ea42gh
May 19, 2021, 10:20pm
3
Thank you both for the solutions!
ErrorBars felt slightly counter-intuitive to me on first encounter – the errors are absolute deviations from the center, and not coordinate themselves like the center points. Although arguments probably can be made the other way round…
Jhsmit
November 16, 2021, 8:59pm
5
How can I change the color of the upper/lower heads?
In bokeh its done via upper_head.line_color: python - Bokeh whisker head color - Stack Overflow
Can I access such nested properties in HoloViews?
Hoxbro
November 17, 2021, 7:27pm
6
I don’t think there is a “clean” way to do this, but it can be done with hooks!
import holoviews as hv
import numpy as np
hv.extension("bokeh")
def hook(plot, element):
plot.handles["glyph"].upper_head.line_color = "red"
plot.handles["glyph"].lower_head.line_color = "green"
errors = [(0.1*i, np.sin(0.1*i), np.random.rand()/2, np.random.rand()/4) for i in np.linspace(0, 100, 11)]
hv.Curve(errors) * hv.ErrorBars(errors, vdims=['y', 'yerrneg', 'yerrpos']).opts(hooks=[hook])
2 Likes