![](/img/trans.png)
[英]Is there a way to specify subplots titles in FacetGrid seaborn?
[英]How to get different titles for each of the subplots in seaborn
我無法獲得第一個箱線圖的標題/X-Label 和 Y-Label。 第二個 BoxPlot 給了我標簽/標題。 我可以改進什么?
fig, (ax1,ax2) =plt.subplots(1,2,figsize=(30,15))
sns.boxplot(y = 'CVotesUS', x = 'IFUS', data = movies, ax=ax1)
plt.title('US Votes')
plt.xlabel('US & Non-US Movies')
plt.ylabel('US Voters')
sns.boxplot(y = 'CVotesnUS', x = 'IFUS', data = movies, ax=ax2)
plt.title('Non-US Votes for US and Non-US Movies')
plt.xlabel('US & Non-US Movies')
plt.ylabel('Non-US Voters')
使用 ax1 和 ax2 設置標題,標簽不是 plt。
fig, (ax1,ax2) =plt.subplots(1,2,figsize=(30,15))
sns.boxplot(y = 'CVotesUS', x = 'IFUS', data = movies, ax=ax1)
ax1.set_title('US Votes')
ax1.set_xlabel('US & Non-US Movies')
ax1.set_ylabel('US Voters')
sns.boxplot(y = 'CVotesnUS', x = 'IFUS', data = movies, ax=ax2)
ax2.set_title('Non-US Votes for US and Non-US Movies')
ax2.set_xlabel('US & Non-US Movies')
ax2.set_ylabel('Non-US Voters')
為了演示,我將sns.boxplot()
保留為空
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.