impossible to deactivate minor grid in logscale

Hi

If I set the scale to log and set the grid to minor
then, it is impossible to deactivate the grid
It does not happen with major or without the logscale

The code to reproduce the problem

import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(range(100), range(100))

#If comment the following line everything is fine
ax.set_xscale(‘log’)

xaxis = ax.get_xaxis()
xaxis.grid(which = ‘Minor’)

xaxis.grid(False)
plt.show()

Thanks
Federico

···


Y yo que culpa tengo de que ellas se crean todo lo que yo les digo?

– Antonio Alducin –

Federico,

You were so close! Try this:
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(range(100), range(100))

#If comment the following line everything is fine
ax.set_xscale('log')

xaxis = ax.get_xaxis()
xaxis.grid(False, which='minor')
xaxis.grid(False, which='major')
plt.show()

Hope that helps,
-paul

···

On Wed, Feb 29, 2012 at 4:09 PM, Federico Ariza <ariza.federico@...287...> wrote:

Hi

If I set the scale to log and set the grid to minor
then, it is impossible to deactivate the grid
It does not happen with major or without the logscale

The code to reproduce the problem

import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(range(100), range(100))

#If comment the following line everything is fine
ax.set_xscale('log')

xaxis = ax.get_xaxis()
xaxis.grid(which = 'Minor')
xaxis.grid(False)
plt.show()

Thanks
Federico
--
Y yo que culpa tengo de que ellas se crean todo lo que yo les digo?

-- Antonio Alducin --

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options