Matplotlib: AxesSubplot object has no tick_params attribute

I am trying to make a simple plot using matplotlib imported via pylab: from pylab import *

list_of_files=[('EXP001.txt','EXP001'),('EXP002.txt','EXP002'),('EXP003.txt','EXP003'),('EXP004.txt','EXP004')]

datalist = [ ( loadtxt(filename), label ) for filename, label in list_of_files ]

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

for data, label in datalist:
line,= loglog( data[:,0], data[:,2], ls='-', marker='.', label=label)

ax.tick_params(axis='x', reset=True, which='minor', labelbottom='on')

legend()
title("EXP001 Simulations")
xlabel("k in $h/Mpc$ ")
ylabel("$P(k)$")
savefig('./pyprueba.png',dpi=200)
show() 

      

But I keep getting the error:

File "pyplot.PS.py", line 13, in <module>
ax.tick_params(axis='x', reset=True, which='minor', labelbottom='on')
AttributeError: 'AxesSubplot' object has no attribute 'tick_params'

      

I extracted some of this code from the examples on this website and the official documentation examples, so I really don't know what the problem is.

+3


source to share





All Articles