python - 如何增加 Matplotlib 图的大小?

标签 python matplotlib mosaic-plot

我用 Matplotlib 做了一个马赛克图,但是由于大量的数据点,图被挤压,单词相互重叠。我想增加地 block 的大小。我试过:

plt.figure(figsize=()) 

没用。

这是我的代码:

from statsmodels.graphics.mosaicplot import mosaic
import matplotlib.pyplot as plt

plt.figure(figsize=(200,10)) #does not work
plt.rcParams['font.size'] = 10.0
mosaic(plants_sub, ['Symbol', 'Family'], gap=0.1);

输出:

enter image description here

最佳答案

添加这个:-

plt.rcParams["figure.figsize"]=(enter your fig width, enter your fig height)

关于python - 如何增加 Matplotlib 图的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60897329/

相关文章:

pandas - 从 Pandas 数据帧覆盖 seaborn 中的两个热图(一个是围绕另一个单元格的框架)

python - 如何在 matplotlib 中绘制双对数直方图

r - geom_mosaic : X axis tick labels not showing?

python - 如何从列表中选择 Selenium 中的项目?

python - 平凡仿函数

python - matplotlib 中的命名颜色

r - 使用网格修改 vcd::马赛克图

python - GeoJSON 数据不包含有意义的数据 GeoDjango

Python每分钟读取txt文件600x-1200x的后果

pandas - Statsmodels 马赛克图 ValueError : cannot convert float NaN to integer