首页 > 解决方案 > 如何增加饼图的大小

问题描述

sales2 = sales.groupby(['State'])[['Sales2016']].sum()

sales2graph = sales2.plot(kind='pie', 
            labels=sales2['Sales2016'], 
            colors=['r', 'g', 'b'],
            autopct='%1.0f%%', # to get percentage and round off appropriately
            fontsize=10, 
            subplots='true')

我的图片在下面。我添加了 <code>radius=1800, frame=True</code> 但无济于事

标签: matplotlib

解决方案


使用figsize

sales2graph = sales2.plot(kind='pie', 
            labels=sales2['Sales2016'], 
            colors=['r', 'g', 'b'],
            autopct='%1.0f%%', # to get percentage and round off appropriately
            fontsize=10, 
            subplots='true',
            figsize=(10,8))

推荐阅读