matplotlib the main python graphics library for and plotting is matplotliband its subpackage pyplot contains collection of functions that make plotting in python similar to that in matlab creating basic plot the code below illustrates various possibilities for creating plots the style and color of lines and markers can be changedas well as the font size of the labels figure shows the result sqrtplot py import matplotlib pyplot as plt import numpy as np np arange ( np arange ( , np sqrt(xv / plt figure figsize [ , ]size of plot in inches plt plot( , ' --'plot green dashed line plt plot( , ,' 'plot red dots plt xlabel (' 'plt ylabel (' 'plt tight_layout (plt savefig ('sqrtplot pdf ',format ='pdf 'saving as pdf plt show (both plots will now be drawn figure simple plot created using pyplot the library matplotlib also allows the creation of subplots the scatterplot and histogram in figure have been produced using the code below when creating histogram there are several optional arguments that affect the layout of the graph the number of bins is determined by the parameter bins (the default is scatterplots also take number of parameterssuch as string which determines the color of the dotsand alpha which affects the transparency of the dots