Horizontal Error Bars#
This example overlays a scatter plot of the mean bill length of a set of penguins per island with error bars computed from their standard deviation.
import hvplot.pandas # noqa
df = hvplot.sampledata.penguins("pandas")
df = df.groupby("island").agg({"bill_length_mm": ["mean", "std"]})
df.columns = df.columns.droplevel(0)
scatter = df.hvplot.scatter(y="mean")
errorbars = df.hvplot.errorbars(
y="mean",
yerr1="std",
invert=True,
ylabel="Bill Length (mm)",
title="Horizontal Error Bars (Bokeh)",
)
scatter * errorbars
import hvplot.pandas # noqa
hvplot.extension("matplotlib")
df = hvplot.sampledata.penguins("pandas")
df = df.groupby("island").agg({"bill_length_mm": ["mean", "std"]})
df.columns = df.columns.droplevel(0)
scatter = df.hvplot.scatter(y="mean")
errorbars = df.hvplot.errorbars(
y="mean",
yerr1="std",
invert=True,
ylabel="Bill Length (mm)",
title="Horizontal Error Bars (Matplotlib)",
)
scatter * errorbars
This web page was generated from a Jupyter notebook and not all
interactivity will work on this website.