python - 如何更改 seaborn 轴或图形级别图的图形大小

如何更改图像的大小以使其适合打印?

例如,我想使用 A4 纸,横向尺寸为 11.7 英寸 x 8.27 英寸。

最佳答案

您还可以通过在 seaborn set 方法中使用键 'figure.figsize' 将字典传递给 rc 参数来设置图形大小:

import seaborn as sns

sns.set(rc={'figure.figsize':(11.7,8.27)})

其他替代方法可能是使用 rcParamsfigure.figsize 来设置图形大小,如下所示:

from matplotlib import rcParams

# figure size in inches
rcParams['figure.figsize'] = 11.7,8.27

更多详情请见 matplotlib documentation

https://stackoverflow.com/questions/31594549/

相关文章:

python - 如何从 Python 中的字典中提取所有值?

c - 如何从 C 程序中获得 100% 的 CPU 使用率

python - functools partial 是如何做到的?

linux - Git 和硬链接(hard link)

linux - git中钩子(Hook)的符号链接(symbolic link)

python - 使用 url_for() 在 Flask 中创建动态 URL

linux - 如何为长路径制作 "alias"?

linux - 如何删除 CLOSE_WAIT 套接字连接

python - 理解 NumPy 的 einsum

linux - VIM:如何在 Ubuntu 上精确到行