|
我用相同的代码画图,x轴要隔5个显示一下,在kali下面运行正常,可以得到我需要的效果,但是同样的代码在ubuntu server上,x轴就彻底不显示了,什么原因呢? 谢谢!
fig = plt.figure(filename)
ax1 = fig.add_subplot(2,2,1)
ax1.plot(df['time'], df['rxb'], label='rxb')
ax1.plot(df['time'], df['txb'], label='txb')
plt.ylabel('Bytes')
pl.xticks(rotation=90)
for label in ax1.get_xticklabels():
label.set_visible(False)
for label in ax1.get_xticklabels()[::5]:
label.set_visible(True)
plt.legend(bbox_to_anchor=(0, 1), loc='right', ncol=1)
|
|