繁体   English   中英

ipython笔记本中的pandas subplot标题大小

[英]pandas subplot title size in ipython notebook

我在一个ipython笔记本电池中并排绘制了两个图。 但是,我无法改变标题的大小。 我可以通过添加参数fontsize = 20来更改标签的大小。 如何更改dfdf2的标题。

fig, axes = plt.subplots(ncols=2, figsize = (20,10))
df.plot('barh', title = 'Legal Collectible Answer Distribution', fontsize = 20, ax = axes[0])
df2.plot(kind = 'pie', autopct = '%1.0f%%', legend = False, title = 'Legal Collectible Answer Distribution', fontsize = 20, ax =axes[1])

您可以使用title.set_size()更改Axes上现有标题的大小

axes[0].title.set_size(40)

尝试将title属性分解为自己,这应该是这样的:

df.plot.title('Legal Collectible Answer Distribution', fontsize=20)
df2.plot.title('Legal Collectible Answer Distribution', fontsize=20)

从绘图命令中删除标题,不知道为什么它不能正常工作,但在快速测试中,它也不能内联工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM