Here I have a dataframe, and I want to plot the error bar plots
import pandas as pd
import matplotlib.pyplot as plt
rows = ["N", "W", "E", "S"]
cols = ["x_mean","y_mean","x_se","y_se"]
data = ([50, 40, 2, 5], [30, 34, 3, 5], [60, 45, 8, 3], [80, 60, 5, 5])
df = pd.DataFrame(data, index = rows, columns = cols)
x_mean y_mean x_se y_se
N 50 40 2 5
W 30 34 3 5
E 60 45 8 3
S 80 60 5 5
# plot
df[["x_mean", "y_mean"]].plot(kind = "bar", yerr = df[["x_se", "y_se"]], rot = 1)
However, the error bar does not show up, any hint or help is welcome
- This follows the same format as the pivoted data in Adding error bars to grouped bar plot in pandas, so it's not clear why the error bars don't display.