First you need to install matplotlib
package through pip
command. In command prompt type pip install matplotlib
.
Then you can create a plot using the following code:
main.py270 chars11 lines
This code creates a simple line plot of x
and y
. plt.xlabel()
, plt.ylabel()
, and plt.title()
functions are used to label the axes and set a title to the plot. Finally, plt.show()
function is used to display the plot.
gistlibby LogSnag