好奇的Matplotlib刻度标签对齐

时间:2015-01-25 02:27:29

标签: python matplotlib

此代码:

import numpy as np
import matplotlib.pyplot as plt
letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
x = range(26)
v = np.random.random(26)

fig = plt.figure()
ax = fig.add_subplot(111)

ax.bar(x, v, width=0.8, align='center')

ax.set_xticks(x)
ax.set_xticklabels(letters)
plt.savefig('so.eps')

生成下图: enter image description here

正如您所看到的,' Q'未正确对齐基线并且看起来不对。

任何人都可以对此有所了解吗?如果它是Matplotlib中的一个错误,是否有一个黑客可以绕过它(例如通过重新排列一个xtick标签)?

我的text.usetex : True文件中有matplotlibrc,只有当我将数字保存为eps时才出现问题。

0 个答案:

没有答案
相关问题