本文对下图中坐标轴(axis),刻度值(trick label),刻度(tricks),子图标题(title),图标题(suptitle),坐标轴标题(xlabel,ylabel),网格线(grid)等 参数的详细设置,不过相对于官网还只是冰山一角。
欢迎随缘关注@pythonic生物人
![9e046d0c7b7ae38cf25fba54cb1c6143.png](https://i-blog.csdnimg.cn/blog_migrate/fb8355a161bcb9823ded6d6a3f1c36b5.jpeg)
上代码:
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] =['Microsoft YaHei']
plt.rcParams['axes.unicode_minus'] = False
plt.figure(dpi=150)
#整张图figure的标题自定义设置
plt.suptitle('整张图figure的标题:suptitle',#标题名称
x=0.5,#x轴方向位置
y=0.98,#y轴方向位置
size=15, #大小
ha='center', #水平位置,相对于x,y,可选参数:{'center', 'left', right'}, default: 'center'
va='top',#垂直位置,相对不x,y,可选参数:{'top', 'center', 'bottom', 'baseline'}, default: