小编Utk*_*jan的帖子

Matplotlib:如何更改双栏图的大小

我已经使用以下代码在matplotlib中绘制了一个双条图:

x = pd.Series(range(12))
y = self.cust_data['Cluster_ID'].value_counts().sort_index()
z = self.cust_data['Cluster_ID_NEW'].value_counts().sort_index()
plt.bar(x + 0.0, y, color = 'b', width = 0.5)
plt.bar(x + 0.5, z, color = 'g', width = 0.5)
plt.legend(['Old Cluster', 'New Cluster'])
plt.savefig("C:\\Users\\utkarsh.a.ranjan\\Documents\\pyqt_data\\generate_results\\bar", bbox_inches='tight',pad_inches=0.1)
plt.clf()
Run Code Online (Sandbox Code Playgroud)

我想使用figsize参数使结果图的尺寸更大。当绘制单个条形图时,这很容易,但是在这里,我对放置figsize参数的位置感到困惑。

python matplotlib

3
推荐指数
2
解决办法
1万
查看次数

标签 统计

matplotlib ×1

python ×1