import matplotlib.pyplot as pltx = [0,1,2,3,4,5,6]y = [9,10,11,12,13,14,15]# Plots the x and yplt.plot(x,y)# Display the plotplt.show()plt.plot(x_points, y_points, marker = 'marker_symbol')plt.plot(x_points, y_points, linestyle = 'line_symbol')plt.plot(x_points, y_points, color = 'color_symbol')plt.plot(x_points,y_points,'marker_symbol:line_symbol:color_symbol')plt.title(title)plt.xlabel(xlabel)plt.ylabel(ylabel)font = {'family':'font_type','color':'color_symbol','size':font_size}font = {'family':'serif','color':'b','size':30}plt.title(title, fontdict=font)plt.grid() - Gridlines in x and y axisplt.grid(axis='x')- Gridlines in x axis aloneplt.grid(axis='y') - Gridlines in y axis aloneplt.subplot(rows,columns,index)import matplotlib.pyplot as plt#plot 1x = [1, 2, 3, 4]y = [1, 2, 3, 4]#First subplotplt.subplot(2, 1, 1)plt.plot(x,y)#plot 2x = [0, 1, 2, 3]y = [0, -1, -2, -3]#Second subplotplt.subplot(2, 1, 2)plt.plot(x,y)plt.show()plt.scatter(x,y)plt.bar(x,y,width=size,height=size,color='color_symbol')plt.barh(x,y,width=size,height=size,color='color_symbol')plt.hist(x)plt.pie(x,labels = labels_list)No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.