Use the Seaborn editor. pd and plt are ready. DataFrame.plot is matplotlib underneath.
Goal
Draw a bar with df.plot.
df = pd.DataFrame({
"city": ["Nairobi", "Mombasa", "Kisumu", "Nakuru", "Eldoret"],
"units": [21, 15, 15, 18, 12],
"shillings": [2100, 1500, 1480, 1750, 1190],
})
df.plot(x="city", y="units", kind="bar")
plt.title("Units")
plt.show()df = pd.DataFrame({
"city": ["Nairobi", "Mombasa", "Kisumu", "Nakuru", "Eldoret"],
"units": [21, 15, 15, 18, 12],
"shillings": [2100, 1500, 1480, 1750, 1190],
})
print(df)
df.plot(x="city", y="shillings", kind="barh")
plt.show()Pitfall
The pandas editor has no Plot pane — stay on the Seaborn workbench.