Answers for "plt. bar matplotlib"

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
0

matplotlib bar

# Import packages
import matplotlib.pyplot as plt
%matplotlib inline

# Create the plot
fig, ax = plt.subplots()

# Plot with bar()
ax.bar(x, y)

# Set x and y axes labels, legend, and title
ax.set_title("Title")
ax.set_xlabel("X_Label")
ax.set_ylabel("Y_Label")
Posted by: Guest on February-05-2021

Python Answers by Framework

Browse Popular Code Answers by Language