失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > Python matplotlib 画图 设置标题 大标题 副标题 大小 位置 粗细全集

Python matplotlib 画图 设置标题 大标题 副标题 大小 位置 粗细全集

时间:2019-02-19 01:39:00

相关推荐

Python matplotlib 画图 设置标题 大标题 副标题 大小 位置 粗细全集

设置标题大小

设置标题字体

设置标题位置

设置标题字体粗细

设置标题斜体

设置大标题大小

设置大标题字体

设置大标题位置

设置大标题字体粗细

设置大标题斜体

其实是大标题

设置副标题大小

设置副标题字体

设置副标题位置

设置副标题字体粗细

设置副标题斜体

from matplotlib import rcParamsimport matplotlib.pyplot as pltfig,axes = plt.subplots(1,1,figsize=(4,4),dpi=100,facecolor="w")fig.subplots_adjust(left=0.2,bottom=0.2)label_fontdict = {#'fontsize': rcParams['axes.titlesize'], # 设置成和轴刻度标签一样的大小'fontsize': 10,#'fontweight': rcParams['axes.titleweight'], # 设置成和轴刻度标签一样的粗细'fontweight': 'bold',#'color': rcParams['axes.titlecolor'], # 设置成和轴刻度标签一样的颜色'color': 'red','verticalalignment': 'baseline','horizontalalignment': 'left' # {'center', 'left', 'right'}}axes.set_title('title', fontdict=label_fontdict, loc='left', pad=0)# x,y 控制suptitle标题的位置# horizontalalignment 缩写ha 文本相对于(x, y)的水平对齐方式。{'center', 'left', 'right'}, default: center# verticalalignment 缩写va 文本相对于(x, y)的垂直对齐方式。{'top', 'center', 'bottom', 'baseline'}, default: top# fontweight default: 'normal'fig.suptitle('suptitle', fontsize=24, x=0.6,y=0.9, horizontalalignment='left', va='bottom')# 通过调整xy位置,和文字方向rotation,也可以将suptitle设置到y轴附近

如果觉得《Python matplotlib 画图 设置标题 大标题 副标题 大小 位置 粗细全集》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。