在使用Python绘制条形图时忽略Figsize参数

在使用Python绘制条形图时忽略Figsize参数,python,pandas,matplotlib,size,bar-chart,Python,Pandas,Matplotlib,Size,Bar Chart,下面的代码生成嵌入的绘图,但由于我不理解的原因,定义绘图大小(figsize)的参数显然被忽略 plt.figure(figsize=(15, 15)) ax = SP500_Growth_quantiles.plot(kind = 'bar') ax.set_title('Quantiles of the Probability Distribution of S&P 500 Growth in 2018') ax.set(ylabel = 'S&P 500 Growth i

下面的代码生成嵌入的绘图,但由于我不理解的原因,定义绘图大小(figsize)的参数显然被忽略

plt.figure(figsize=(15, 15))

ax = SP500_Growth_quantiles.plot(kind = 'bar')
ax.set_title('Quantiles of the Probability Distribution of S&P 500 Growth in 2018')
ax.set(ylabel = 'S&P 500 Growth in 2018', xlabel = 'Quantile')
图片:

你是说

fig, ax = plt.subplots(figsize=(15, 15))
SP500_Growth_quantiles.plot(kind = 'bar', ax=ax)
ax.set_title('Quantiles of the Probability Distribution of S&P 500 Growth in 2018')
ax.set(ylabel = 'S&P 500 Growth in 2018', xlabel = 'Quantile')