Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matplotlib 我如何才能让我的传奇更大?_Matplotlib_Seaborn - Fatal编程技术网

Matplotlib 我如何才能让我的传奇更大?

Matplotlib 我如何才能让我的传奇更大?,matplotlib,seaborn,Matplotlib,Seaborn,我有以下代码: ax = sns.catplot(x='account_name', y='cnt', hue='threat_campaigns',data=df_mitigation,kind='bar', height=15, aspect=3.1, palette='coolwarm' ) ax.fig.suptitle("Accounts' violations disribuation over the last week", fontsize=40) plt.y

我有以下代码:

ax = sns.catplot(x='account_name', y='cnt', hue='threat_campaigns',data=df_mitigation,kind='bar', height=15, aspect=3.1, palette='coolwarm' )
ax.fig.suptitle("Accounts' violations disribuation over the last week", fontsize=40)
plt.yscale("log")


plt.xlabel('Account', fontsize=40)
plt.ylabel('Number of requests', fontsize=40)
plt.setp(ax._legend.get_title(), fontsize=40)

plt.show()

查看我在屏幕截图中得到的内容-所有内容都很小-如何将其变大。

您可以使用sns.plotting_context(rc={“legend.fontsize”:24,“legend.title_fontsize”:24}之类的示例更新
rcParams
词典

可复制的例子

df = sns.load_dataset('flights')
with sns.plotting_context(rc={"legend.fontsize":24, "legend.title_fontsize":24}):
    ax = sns.catplot(x='year', y='passengers', hue='month', data=df, kind='bar', height=15, aspect=3.1, palette='coolwarm')
    plt.show()
之前:

之后:


您可能希望缩小体型。。。你要的是一个大约15英寸高,45英寸宽的数字。对于接近默认大小的图形,默认字体大小会更好。@meitale,我回答了你的问题了吗。请单击解决方案旁边的复选标记接受答案。以下是如何接受答案。向上投票也很感谢:谢谢!