在简介里介绍了很多了,这里补充一点
Axes包含一个属性patch,是Axes对应的方框,可以用来设置Axes的相关属性
ax = fig.add_subplot()
rect = ax.patch # a Rectangle instance
rect.set_facecolor('green')
Axes有以下方法
Axes helper method | Artist | Container |
---|---|---|
annotate - text annotations | ax.texts | |
bar - bar charts | ax.patches | |
errorbar - error bar plots | ax.lines and ax.patches | |
fill - shared area | ax.patches | |
hist - histograms | ax.patches | |
imshow - image data | ax.images | |
legend - Axes legend | ax.get_legend() | |
plot - xy plots | ax.lines | |
scatter - scatter charts | ax.collections | |
text - text | ax.texts |
Axes有以下属性
Axes attribute | Description |
---|---|
artists | An ArtistList of Artist instances |
patch | Rectangle instance for Axes background |
collections | An ArtistList of Collection instances |
images | An ArtistList of AxesImage |
lines | An ArtistList of Line2D instances |
patches | An ArtistList of Patch instances |
texts | An ArtistList of Text instances |
xaxis | A matplotlib.axis.XAxis instance |
yaxis | A matplotlib.axis.YAxis instance |