Answers for "matplotlib bar stacked"

3

bar plot matplotlib

import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
langs = ['C', 'C++', 'Java', 'Python', 'PHP']
students = [23,17,35,29,12]
ax.bar(langs,students)
plt.show()
Posted by: Guest on May-14-2020
3

matplotlib bar chart

import matplotlib.pyplot as plt

# Create a Simple Bar Plot of Three People's Ages

# Create a List of Labels for x-axis
names = ["Brad", "Bill", "Bob"]

# Create a List of Values (Same Length as Names List)
ages = [9, 5, 10]

# Make the Chart
plt.bar(names, ages)

# Show the Chart
plt.show()
Posted by: Guest on July-04-2020

Python Answers by Framework

Browse Popular Code Answers by Language