似乎很漂亮的Googleable,但一直沒有找到能夠在網上找到的東西。我試過sns.boxplot('Day', 'Count', data= gg).title('lalala')
和sns.boxplot('Day', 'Count', data= gg).suptitle('lalala')
。沒有工作。我想這可能是因爲我也在使用matplotlib。如何將標題添加到seaborn boxplot
11
A
回答
4
試着在你的代碼的末尾添加這樣的:
import matplotlib.pyplot as plt
plt.title('add title here')
20
Seaborn箱線圖返回matplotlib軸實例。不像pyplot本身,它有一個方法plt.title()
,軸的對應參數是ax.set_title()
。因此,你需要調用
sns.boxplot('Day', 'Count', data= gg).set_title('lalala')
一個完整的例子是:
import seaborn as sns
import matplotlib.pyplot as plt
tips = sns.load_dataset("tips")
sns.boxplot(x=tips["total_bill"]).set_title("LaLaLa")
plt.show()
當然你也可以使用返回的軸實例,以使其更易於閱讀:
ax = sns.boxplot('Day', 'Count', data= gg)
ax.set_title('lalala')
ax.set_ylabel('lololo')
相關問題
- 1. 如何將標題添加到Seaborn Heatmap顏色條?
- 2. 將splitplot(dotplot)添加到分組boxplot中 - Panda和Seaborn
- 3. 將標籤添加到facet_wrap boxplot
- 4. Seaborn boxplot中盒子的座標
- 5. 在seaborn boxplot中旋轉xtick標籤?
- 6. 如何將標題添加到GridView?
- 7. 如何將標題添加到Imagick polaroidImage?
- 8. 如何將unicode添加到python標題?
- 9. 如何將html添加到alchemy.js標題
- 10. 如何將標題添加到ActionBarSherlock
- 11. 在seaborn boxplot上設置ylim
- 12. 在Seaborn boxplot中獲取值
- 13. 將行添加到GGPLOT2中的Boxplot
- 14. Boxplot將行添加到單個框中
- 15. 如何爲Seaborn Facet劇情添加標題
- 16. 將數據添加到seaborn jointplot
- 17. 將標題/標題添加到telerik Radgrid?
- 18. 將標題添加到PreferenceActivity
- 19. 將標題添加到window.location.pathname
- 20. 將標題添加到UITextView
- 21. 將標題添加到UIPickerView
- 22. 如何將透明矩形添加到R boxplot(plot)?
- 23. 如何使用ggplot2將線條添加到boxplot
- 24. 將數據標籤添加到Seaborn因子圖
- 25. 在ggplot2 boxplot上添加多個標籤
- 26. 將標題標籤添加到Zend_Form_Element_MultiCheckbox
- 27. 如何把BOLD標題放入seaborn factorplot
- 28. GridView的CSS問題。如何將CSS添加到標題tr
- 29. 如何將圖標添加到導航抽屜中的標題?
- 30. 如何將圖像和標籤添加到UINavigationBar作爲標題?