#直方图
a = np.array([22,87,5,43,56,73,55,54,11,20,51,5,79,31,27])
plt.hist(a, bins =[0,20,40,60,80,100])
plt.title("histogram")
plt.show()
#heatmap#Generate a random number, you can refer your data values also
data = np.random.rand(4,2)
rows =list('1234')#rows categories
columns =list('MF')#column categories
fig,ax=plt.subplots()#Advance color controls
ax.pcolor(data,cmap=plt.cm.Reds,edgecolors='k')
ax.set_xticks(np.arange(0,2)+0.5)
ax.set_yticks(np.arange(0,4)+0.5)# Here we position the tick labels for x and y axis
ax.xaxis.tick_bottom()
ax.yaxis.tick_left()#Values against each labels
ax.set_xticklabels(columns,minor=False,fontsize=20)
ax.set_yticklabels(rows,minor=False,fontsize=20)
plt.show()
import matplotlib.pyplot as pltimport numpy as npimport pandas as pdimport datetime#散点图height=[161,170,182,175,173,165]weight=[50,58,89,80,79,68]plt.scatter(height,weight)````python#折线图x=np.linspace(-10,10,100)y=x**2plt.plot(x,y)#直接用Series