One more update, before heading to the bed.

I have managed to adjust my ticks to get what I was asking originally. See the code at http://pastebin.com/XjkDZ486

1-) ax1.yaxis.set_minor_locator(ticker.LogLocator(subs=np.arange(2.0, 10.0)))

with this line I can get the desired number of minor ticks at the correct positions

2-) #ax1.xaxis.set_ticks(10.**np.arange(np.log10(xmin),np.log10(xmax)+1,1))

this line puts major at every decade but minors aren’t printed correctly due to striding at major ticks.

3-) To get this one working I needed to modify the code within the ticker.LogLocator()

particularly the two lines starting at https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/ticker.py#L1311

decades = np.arange(math.floor(vmin),

math.ceil(vmax)+stride, stride)

edited to

decades = np.arange(math.floor(vmin),

math.ceil(vmax)+1, 1)

previously I was getting a major tick at every other decade. With this change I get a major tick at every decade plus the minor ticks look nicer. So my opinion is this stride should be parameter to the LogLocator(), so based on what people wants to plot it can be easily adjusted.

Any comments/other solutions?

Thanks.

## ···

On Fri, Sep 23, 2011 at 10:47 PM, Gökhan Sever <gokhansever@…287…> wrote:

OK,

This fixes the minor locations on y-axis

ax1.yaxis.set_minor_locator(ticker.LogLocator(subs=np.arange(2.0, 10.0)))

Independent of the data-range. It seems like ticker.LogLocator is trying to adjust the minor locs internally.

On Fri, Sep 23, 2011 at 7:18 PM, Gökhan Sever <gokhansever@…287…> wrote:

Hi,

Another question is, what sets the tick-location on a log scaled axis? (that 10^-5, 10^-3, 10^-1, 10^1) It seems as if the range is greater than certain value ticks are located this way. Also in a similar way, the location of minor ticks are decided. (If the range is big, no minor ticks, if the range is not too big, put 4 minor ticks --which is very inconvenient to eye, if range is small then nicely locate 9 minor ticks.)

Hah, the next probably will be manually forcing the _ticks or ticklocator functions.

Anyone else experiencing similar behavior in mpl?

On Fri, Sep 23, 2011 at 1:07 PM, Gökhan Sever <gokhansever@…1972…> wrote:

Hello,

Considering this example plot: http://imageshack.us/photo/my-images/27/imagefki.png/

How can I get the minor ticks showing correctly? (ie., 9 minor ticks per decade likewise for the x-axis)

For some reason

axis.set_minor_locator(LogLocator(numdecs=9) is not producing the desired output.

Any hints?

Thanks.

–

Gökhan

–

Gökhan

–

Gökhan

–

Gökhan