I want to plot a curve with error bars in holoviews
using the matplotlib
backend. I would like the curve and the error bars to be the same color, but without explicitly specifying the color for the curve. I.e. I can easily do this
import holoviews as hv
hv.extension("matplotlib")
means = [1, 4, 2, 3]
errors = [0.3, 0.5, 0.2, 0.1]
color = "green"
mean_plot = hv.Curve(means).opts(color=color)
err_plot = hv.ErrorBars((range(len(means)), means, errors)).opts(edgecolor=color)
mean_plot * err_plot
to get
but what if I was given mean_plot
and didn't already know its color? I'm sure the current options must be stored somewhere on the instance, but I don't know how to access them. I'd like to do something like
mean_color = mean_plot.<access_options_somehow>.color
err_plot = hv.ErrorBars((range(len(means)), means, errors)).opts(edgecolor=mean_color)