Python
Matplotlib
Bar
Create horizontal
Bar charts are important tools for creating comparative visualizations of discrete data. Matplotlib makes it easy to create these powerful plots.
Use the plt.barh()
function to create a horizontal bar plot in Matplotlib.
import matplotlib.pyplot as plt
labels = ['Amy', 'Rob', 'Dimitri', 'Sarah', 'Brian']
values = [60, 56, 63, 75, 48]
# Create horizontal bar plot here
plt.barh(labels, values)
plt.ylabel('Typing Speed (wpm)')
plt.show()
To create a vertical bar plot, take a look at this article.