log plots: label minor ticks

Is it possible to have labels on minor ticks, on log plots?

    > I've tried

    >>>> gca().get_major_formatter().label_minor(True)

    > but it doesn't work.

Just some advice on how to help you get to where you want to go. Have
you seen the matplotlib examples directory in the src distribution, at
http://matplotlib.sf.net/examples and zipped at
http://matplotlib.sourceforge.net/matplotlib_examples_0.72.zip ?

If you scroll through there, sometimes you see and example that will
help with the problem at hand. In this case major_minor_demo1.py,
major_minor_demo2.py, custom_ticker1.py, and log_demo.py will probably
all offer some insight. Though none explicitly address the problem at
hand, the would have shown you the right syntax to set minor
formatters. Eg from major_minor_demo1.py


    #for the minor ticks, use no labels; default NullFormatter

From this you might guess ax.xaxis.set_minor_formatter.

Also, if you fire up a python shell, and get the type of ax.xaxis, you
can get more information

  >>> ax = subplot(111)
  >>> dir(ax.xaxis)
  >>> help(ax.xaxis.set_minor_formatter)

The class docs are also helpful here, eg the Axis docs at
http://matplotlib.sourceforge.net/matplotlib.axis.html .

This is not meant as criticism or RTFM -- the docs are admittedly a
bit sparse -- just giving you some guidance to help you the next time.

Now on to your the problem at hand. Something like this...

    from pylab import *

    #formatter = LogFormatterMathtext(base=10, labelOnlyBase=False)
    minorFormatter = LogFormatter(base=10, labelOnlyBase=False)
    majorFormatter = LogFormatter(base=10, labelOnlyBase=True)
    ax = subplot(111)
    x = arange(1, 2000.0, 0.1)
    y = exp(-x/10)
    semilogx(x, y, subsx=(2,5)) # tick minors on 2s and 5s

The LogFormatterMathtext does superscript tick formatting, eg 10^2.
This can look funny for minor ticks, because it does things like

10^{2.3} for 20.

You can of course, design your own formatter.....


Hope this helps,