You can build multiple columns at once by providing a list of column names with the plot
y
argument.
df.plot(x="X", y=["A", "B", "C"], kind="bar")
![enter image description here](https://fooobar.com/undefined)
This will create a graph in which the stripes are next to each other.
So that they overlap, you will need to call plot
several times and set the axes to plot as ax
argument for the graph.
import pandas as pd import matplotlib.pyplot as plt import numpy as np y = np.random.rand(10,4) y[:,0]= np.arange(10) df = pd.DataFrame(y, columns=["X", "A", "B", "C"]) ax = df.plot(x="X", y="A", kind="bar") df.plot(x="X", y="B", kind="bar", ax=ax, color="C2") df.plot(x="X", y="C", kind="bar", ax=ax, color="C3") plt.show()
![enter image description here](https://fooobar.com/undefined)
source share