擅长:python、mysql、java
<p>是的,这是可能的。但是你必须分别旋转每个标签。因此,可以尝试使用迭代:</p>
<pre><code>from matplotlib import pyplot as plt
figure = plt.figure()
ax = figure.add_subplot(111)
t = figure.text(0.5,0.5,"some text")
t.set_rotation(90)
labels = ax.get_xticklabels()
for label in labels:
label.set_rotation(45)
plt.show()
</code></pre>