Matplotlib是一个图形库,是以Numpy库为基础的一个库。我们主要看到的是Artist层。其结构如下图。
?...下面分别介绍各种图形的画法:
1.画线,
import matplotlib.pyplot as plt
import numpy as npt=np.arange(0,6.28,0.1)
t1=np.arange...plt.xlabel('the x axis value',color='red')
plt.ylabel('the y value',color='blue')
plt.text(0.8,0.8,'python_matplotlib...')
plt.barh(index,values,xerr=std1,error_kw={'ecolor':'0.1','capsize':6},alpha=0.7,label='First')
plt.yticks...1,:2])
s1.plot(x1,y1,'r')
s2=fig.add_subplot(gs[0,:2])
s2.bar(x2,y2)
s3=fig.add_subplot(gs[2,0])
s3.barh