【发布时间】:2011-02-09 06:13:55
【问题描述】:
如何在 matplotlib 中的绘图标签(例如 xlabel 或 ylabel)中添加换行符?例如,
plt.bar([1, 2], [4, 5])
plt.xlabel("My x label")
plt.ylabel(r"My long label with $\Sigma_{C}$ math \n continues here")
理想情况下,我希望 y 标记也居中。有没有办法做到这一点?重要的是标签同时包含 TeX(包含在 '$' 中)和换行符。
【问题讨论】:
标签: python plot graphing matplotlib