What is Matplotlib, how to install and use

Matplotlib Basics

1 min read

Published Oct 5 2025


15
0
0
0

ChartsGraphsMatplotlibNumPyPandasPythonVisualisation
website link icon

Matplotlib Official Documentation

This guide only goes through the basics. Matplotlib is capable of much more, visit the official site for more details.


Matplotlib is a powerful and flexible Python library used for creating static, animated, and interactive visualisations.
It’s especially popular in data science, engineering, and academic research for visualising numerical data.




Matplotlib can produce a wide range of chart types, including:

  • Line chartsplt.plot()
  • Scatter plotsplt.scatter()
  • Bar chartsplt.bar(), plt.barh()
  • Histogramsplt.hist()
  • Pie chartsplt.pie()
  • Boxplots & Violin plotsplt.boxplot(), plt.violinplot()
  • Heatmaps & Imagesplt.imshow()



Matplotlib offers deep control over:

  • Titles, labels, legends: plt.title(), plt.xlabel(), plt.legend()
  • Colours, markers, line styles
  • Axes and scales: linear, log, polar, etc.
  • Subplots and layout control: plt.subplot(), plt.subplots()
  • Figure size and resolution: plt.figure(figsize=(w, h), dpi=100)



Installation:

pip install matplotlib



Importing the library:

import matplotlib.pyplot as plt

By convention, it’s always imported as plt.

© 2025 SimpleSteps.guide
AboutFAQPoliciesContact
Matplotlib Basics | What is Matplotlib, how to install and use | SimpleSteps.guide