当我做出pyplot次要情节,然后将光标的位置不正确显示,因为你可以在下面的图片中看到(光标在右上角副区某处(相同的行为经历了所有其他的副区),但是当我提出的屏幕截图,所述光标是不存在(I使用Win10)): []
之间的值是正确的颜色值,但x
和y
值未示出。这只有当我使用subplots时才会发生。
下面是产生了图片代码:Pyplot:光标的位置未显示
def plot_subplots(lam, t):
# lam: list of 4 lambda values, t fixed
f, ax = plt.subplots(2, 2, sharex='col', sharey='row')
((ax1, ax2), (ax3, ax4)) = ax
ax = [ax1, ax2, ax3, ax4]
# get X and K (both equidistant arrays)
for k, l in enumerate(lam):
# get the color array husimi
p = ax[k].pcolorfast(X, K, husimi, cmap='jet')
ax[k].set_title(r'$\lambda='+str(l)+'$')
ax1.set_ylabel(r'$k$')
ax3.set_ylabel(r'$k$')
ax1.set_yticks([min(K), 0, max(K)])
ax1.set_yticklabels([r'$-\pi$', r'$0$', r'$\pi$'])
ax3.set_yticks([min(K), 0, max(K)])
ax3.set_yticklabels([r'$-\pi$', r'$0$', r'$\pi$'])
ax3.set_xlabel(r'$x$')
ax4.set_xlabel(r'$x$')
ax3.set_xticks([min(X), 0, max(X)])
ax4.set_xticks([min(X), 0, max(X)])
ax3.set_xticklabels([r'$'+str(min(X))+'$', r'$0$', r'$'+str(max(X))+'$'])
ax4.set_xticklabels([r'$'+str(min(X))+'$', r'$0$', r'$'+str(max(X))+'$'])
f.suptitle(r'$t_2='+str(t)+'$')
我使用Python 3.4.3 64位和Matplotlib 1.5.2,如果这个问题。是否有人发现在产生这种行为或者这只是plt.pcolorfast
一些bug代码中的错误?
谢谢!很高兴知道,当我以简单的方式设置标签时,我有点摧毁了某些东西。 – Michael