Hi All,
How do I go about showing minor ticks as lines across the whole plot, as opposed to just little ticks at the side?
I can get the major ticks to show by doing grid(True), but how do I get the same effect for minor ticks?
cheers,
Chris
···
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
Chris Withers wrote:
Hi All,
How do I go about showing minor ticks as lines across the whole plot, as opposed to just little ticks at the side?
I can get the major ticks to show by doing grid(True), but how do I get the same effect for minor ticks?
Try
grid(True, which='minor')
Eric
···
cheers,
Chris
Eric Firing wrote:
I can get the major ticks to show by doing grid(True), but how do I get the same effect for minor ticks?
Try
grid(True, which='minor')
Thanks, that worked (well, it did what it was supposed to...) so it'd be nice if it was in the online docs as well as the docstring of the method;-)
However, this isn't quite what I want... I only want the grid for the y-axis (ie: horizontal lines in the grid, but no vertical), how would I do that?
cheers,
Chris
···
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
Hello Chris,
for only horizontal lines you can use 'ax.yaxis.grid' like:
···
---------------------------------------------------
from pylab import *
figure()
ax = axes()
ax.set_yticks([0.0,0.5,1.0], minor=False)
ax.set_yticks(list(linspace(0.0, 1.0, 11)), minor=True)
ax.yaxis.grid(which='minor')
show()
---------------------------------------------------
best regards,
Matthias
On Tuesday 18 March 2008 10:22, Chris Withers wrote:
Eric Firing wrote:
>> I can get the major ticks to show by doing grid(True), but how do I
>> get the same effect for minor ticks?
>
> Try
>
> grid(True, which='minor')
Thanks, that worked (well, it did what it was supposed to...) so it'd be
nice if it was in the online docs as well as the docstring of the method;-)
However, this isn't quite what I want... I only want the grid for the
y-axis (ie: horizontal lines in the grid, but no vertical), how would I
do that?
cheers,
Chris
Matthias Michler wrote:
ax.yaxis.grid(which='minor')
This is what I was after, thankyou
However, the lines show up on top of the lines plotted, not behind them as I'd expect.
I tried fiddling with the zorder of the plot and the grid but nothing had any effect. What am I doing wrong? How do I get the grid to show up behind the lines?
cheers,
Chris
···
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
Chris Withers wrote:
I tried fiddling with the zorder of the plot and the grid but nothing had any effect. What am I doing wrong? How do I get the grid to show up behind the lines?
Actually, I did manage to fix this by specifying a zorder of 10 for the plots and a zorder of 1 for the grids.
What's the default zorder? Ideally I'd just like to supply the zorder to the grids...
cheers,
Chris
···
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
Hello Chris,
in "examples/zorder_demo.py" I found:
···
-----------------------------------------------------------------------------------------------
The default drawing order for axes is patches, lines, text. This
order is determined by the zorder attribute. The following defaults
are set
Artist Z-order
Patch / PatchCollection 1
Line2D / LineCollection 2
Text 3
-------------------------------------------------------------------------------------------------
best regards
Matthias
On Tuesday 18 March 2008 12:15, Chris Withers wrote:
Chris Withers wrote:
> I tried fiddling with the zorder of the plot and the grid but nothing
> had any effect. What am I doing wrong? How do I get the grid to show up
> behind the lines?
Actually, I did manage to fix this by specifying a zorder of 10 for the
plots and a zorder of 1 for the grids.
What's the default zorder? Ideally I'd just like to supply the zorder to
the grids...
cheers,
Chris
Hi Matthias,
Matthias Michler wrote:
in "examples/zorder_demo.py" I found:
-----------------------------------------------------------------------------------------------
The default drawing order for axes is patches, lines, text. This
order is determined by the zorder attribute. The following defaults
are set
Artist Z-order
Patch / PatchCollection 1
Line2D / LineCollection 2
Text 3
-------------------------------------------------------------------------------------------------
So I see, but then why if I set the zorder of the grid to 0 or 1, does it still show up on top of the lines, unless I set the zorder of the lines to 10 or above?
cheers,
Chris
···
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk