I got curious and looked for the grid command in matplotlib/axes.py.
Looks like an inherited-from-Matlab thing. In the cla (clear axis)
function of the Axes class:
self._gridOn = rcParams['axes.grid']
#...
self.grid(self._gridOn)
and grid() passes its argument on
On Tue, May 4, 2010 at 6:27 PM, Nico Schlömer nico.schloe...@gmail.com wrote:
That's really independent of whether the grid is on or off.
Is there any explanation for it that does not have to do with Harry
Potter or the Jedi? ;)
positions of gridlines (and ticks, ticklabels, etc) are updated
On 05/05/2010 08:46 AM, Chloe Lewis wrote:
I got curious and looked for the grid command in matplotlib/axes.py.
Looks like an inherited-from-Matlab thing. In the cla (clear axis)
function of the Axes class:
self._gridOn = rcParams['axes.grid']
#...
If there is a substantial need to read the grid state, we could expose
it via a suitable API at the Axis level. But is this important?
Well, I'm using this for the matplotlib2tikz converter
http://github.com/nicki/matplotlib2tikz which takes a matplotlib
figure and spits out TikZ code. TikZ
This is weird:
When plotting something very simple, e.g.,
t = arange( 0.0, 2.0, 0.01 )
s = sin( 2*pi*t )
plot( t, s, : )
I thought I can check weather the grid is on or off by
gca().get_xgridlines()
-- but this *always* returns
a list of 5 Line2D xgridline objects