Ang*_*ray 6 python matplotlib seaborn
我已经在这里尝试了尽可能多的解决方案,但我对此并不走运。我不确定是不是因为我的一些设置,但我无法重塑我的 Seaborn 计数图。这是我绘制图形的代码:
sns.set_style('whitegrid')
sns.set(font_scale=1.3)
sns.countplot(x=df['QuarterYear'], hue=df['Modifier'])
ax = plt.gca()
for p in ax.patches:
ax.text(p.get_x() + p.get_width()/2., p.get_height(), '%d' % int(p.get_height()),
fontsize=12, color='black', ha='center', va='bottom')
plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
Run Code Online (Sandbox Code Playgroud)
我还在同一代码块中编辑图例并标记我的 countplot 列。
我正在使用 Jupyter Notebook %inline。如果有人能解释我所缺少的东西,那就太好了。我已经尝试了许多这些解决方案的变体,但无济于事。
如何在 Seaborn 中更改 regplot 的绘图大小?
任何帮助,将不胜感激。感谢您的时间!
| 归档时间: |
|
| 查看次数: |
17291 次 |
| 最近记录: |