美文网首页
Python-matplotlib图表中可以设置的内容

Python-matplotlib图表中可以设置的内容

作者: 去他山捡石头 | 来源:发表于2018-07-08 15:19 被阅读0次
  • 子图subplot
fig = plt.figure()
ax1 = fig.add_subplot(2,2,1)  #一共4个子图,分2行2列,ax1是第一个图

另一个方法:

fig = plt.subplots(2,3)
  • subplot的间距
plt.subplots_adjust(wspace=0, hspace=0)
  • 颜色:color,支持全名、缩写,十六进制值
  • 线型:linestyle
  • 线型图上数据点的标记:marker
  • 范围: xlim, ylim
  • 刻度位置: xticks, yticks
  • 刻度标签: xticklabels, yticklabels
  • 图的名称: title
  • X、Y轴的名称: xlabel、ylabel
  • 图例: legend
  • 注解:text/arrow/annotate
  • 背景色: facecolor, edgecolor
  • 字体大小:fontsize
  • 网格: grid
  • 图形: patch

相关文章

网友评论

      本文标题:Python-matplotlib图表中可以设置的内容

      本文链接:https://www.haomeiwen.com/subject/miosuftx.html