Python matplotlib和ggplot-面网格文本大小标签
我在Python matplotlib和ggplot-面网格文本大小标签,python,matplotlib,ggplot2,python-ggplot,Python,Matplotlib,Ggplot2,Python Ggplot,我在日期使用ggplot的facet\u网格函数 p = ggplot(aes(x='meh',weight='mah',fill='type'),data=plot_df) + geom_bar(stat='identity') + facet_grid('date',scales='fixed') + ggtitle(title) 我使用以下参数成功编辑图例和轴尺寸: t = theme_gray() t._rcParams['font.size'] = 30 # Legend font
日期使用ggplot
的facet\u网格函数
p = ggplot(aes(x='meh',weight='mah',fill='type'),data=plot_df) + geom_bar(stat='identity') + facet_grid('date',scales='fixed') + ggtitle(title)
我使用以下参数成功编辑图例和轴尺寸:
t = theme_gray()
t._rcParams['font.size'] = 30 # Legend font size
t._rcParams['xtick.labelsize'] = 30 # xaxis tick label size
t._rcParams['ytick.labelsize'] = 30 # yaxis tick label size
t._rcParams['axes.labelsize'] = 30 # general label size
p = p + t
从所附图像中可以看到,右侧标签(date
)几乎看不清
哪个matplotlib参数控制此标签文本大小?我可以看到matplotlib的自定义选项,但由于facet_grid
是一个ggplot
函数,因此我无法看到这些控件中的哪一个控制此特定标签
编辑
样本:
谢谢@ImportanceOfBeingErnest我添加了一个示例文件(我发现自动生成一个文件太困难)和复制步骤。:)我试图得到一个数字手柄,但这似乎是不可能的plt.gcf()
不返回ggplot facet网格图。fig,(ax,ax2)=p也不返回。使facets()工作。也许其他人有主意。谢谢你尝试@ImportanceOfBeingErnest。
import pandas as pd
from ggplot import *
data_df = pd.read_csv("/dir/sample/input/above/tmp.csv")
print data_df.head()
p = ggplot(aes(x='status',weight='duration_proportion',fill='line_name'),data=data_df) + geom_bar(stat='identity') + labs(x="Service status", y="Percentage time") + facet_grid('date',scales='fixed')
t = theme_gray()
t._rcParams['font.size'] = 30 # Legend font size
t._rcParams['xtick.labelsize'] = 30 # xaxis tick label size
t._rcParams['ytick.labelsize'] = 30 # yaxis tick label size
t._rcParams['axes.labelsize'] = 30
p = p + t
p.save("test.png" ,height=24,width=44)