YouTip LogoYouTip

Matplotlib Tutorial - Charts

Line Chart

import matplotlib.pyplot as plt
plt.plot([1,2,3,4], [1,4,9,16])
plt.title("Simple Chart")
plt.xlabel("X")
plt.ylabel("Y")
plt.show()

Bar Chart

plt.bar(["Python","Java","JS"], [85,70,90])
plt.show()

Summary

  • plt.plot() for line charts
  • plt.bar() for bar charts
← TensorFlow Tutorial - Getting Pandas Tutorial - DataFrames β†’