Matplotlib is a comprehensive library for creating static animated and interactive visualizations in python.
Matplotlib pyplot documentation.
Import numpy as np import matplotlib pyplot as plt x np arange 0 5 0 1 y np sin x plt plot x y.
It provides a matlab like way of plotting.
It provides a matlab like way of plotting.
Matplotlib pyplot is a state based interface to matplotlib.
Develop publication quality plots with just a few lines of code.
Import numpy as np import matplotlib pyplot as plt x np arange 0 5 0 1 y np sin x plt plot x y.
In matplotlib pyplot various states are preserved across function calls so that it keeps track of things like the current figure and plotting area and the plotting functions are directed to the current axes please note that axes here and in most places in the documentation refers to the axes part of a figure and not the strict mathematical term for more than one axis.
Pyplot is mainly intended for interactive plots and simple cases of programmatic plot generation.
Matplotlib makes easy things easy and hard things possible.
Use interactive figures that can zoom pan update.
Matplotlib pyplot is a state based interface to matplotlib.
This is convenient for interactive work but for programming it is recommended that the namespaces be kept separate e g.
Plot args scalex true scaley true data none kwargs source plot y versus x as lines and or markers.