我试图在我的情节上设置特定的刻度,但是"默认"刻度标签仍然可见:
colnames = ['w','h']
data = pandas.read_csv("log_h.csv",names = colnames, sep='\t')
x = data.w.tolist()[:]
y = data.h.tolist()[:]
fig = plt.figure(figsize=(5,3))
plt.tick_params(axis='both', which='major', labelsize=8)
plt.plot(x,y,"r",linewidth=0.7)
plt.xscale('log')
plt.xlabel(r'$\frac{\omega}{2\pi}[Hz]$')
plt.ylabel(r"$|H(i\omega)\|_{dB}$")
plt.rc('grid', linestyle="--", color='lightgrey')
plt.grid(b=True, which='major', color='b', linestyle='--')
plt.grid(b=True, which='minor', color='r', linestyle='--')
plt.xlim(48,52)
plt.ylim(-65,5)
ax = plt.gca()
l = [48,48.5,49,49.5,50,50.5,51,51.5,52]
ax.set_xticks(l)
ax.set_xticklabels(l)
plt.grid(True)
ax.grid(True, which='both')
我明白了:
我想删除大标签5x10 ^ 1。我该怎么做?
[编辑]
如果我删除plt.xlim(...)它没关系,5x10 ^ 1消失了,但我不想绘制整个范围!