semilogy

I want to plot semilogy with major and minor grid. I tried:

plt.grid(which='both')

But 2 problems:

1) For semilogy, most of my viewers will expect to see 10 minor ticks/major
tick. I got 5. How do I change it?

2) I'd like the major ticks to be solid lines, and minor ticks to be dashed. I
got all dashed.

Neal Becker, on 2011-01-05 08:19, wrote:

I want to plot semilogy with major and minor grid. I tried:

plt.grid(which='both')

But 2 problems:

1) For semilogy, most of my viewers will expect to see 10 minor
ticks/major tick. I got 5. How do I change it?

Hi Neal,

odd, it works here. (See attached image)

In [1]: plt.semilogy(((np.random.rand(50)*9+1)))

If your problem persists, can you provide a small example where
this does not work? You might check the minor locator - make
sure that it is base 10

In [2]: plt.gca().yaxis.minor.locator._base
Out[2]: 10.0

2) I'd like the major ticks to be solid lines, and minor ticks
to be dashed. I got all dashed.

In [3]: plt.grid(which='major', linestyle='solid')
In [4]: plt.grid(which='minor', linestyle='dashed')

logticks.png

ยทยทยท

--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7