Label text alignment problem?

    Hello again, I've created some axes, and I'm trying to

    > put some custom Ox tick labels on the axes. I would also
    > like to have different alignments for each tick
    > label. This is the code I'm using (with matplotlib.0.61.0a
    > on Win32 with the WXAgg backend):

Hi, I thought we had lost you to PyPlot :slight_smile:

Egads, that was a tough one. Every once in a while when developing
I'll make a temporary change in the src code for experimental purposes
and forget to undo it. This is one of those cases. In
matplotlib.axis.XAxis, on or around line 575, find the line that reads

                #tick = self._get_tick(major=True)
                tick = protoTick

and replace it with

                tick = self._get_tick(major=True)

The assignment 'tick = protoTick' was causing all ticks to share
properties.

FYI, matplotlib has a fairly general and extensible tick locator and
formatter framework, which you can read about in
http://matplotlib.sf.net/matplotlib.ticker.html and in the examples
custom_ticker1.py, major_minor_demo1.py and major_minor_demo2.py in
the matplotlib src distribution or at
http://matplotlib.sf.net/examples. The set_ticks, set_ticklabels,
etc, commands are just wrappers for these classes.

JDH

Thank you, John. I thought I was lost to PyPlot too, but ... well,
matplotlib is just too cool :slight_smile: So I struggled a bit and I managed to
get a print of the graph by first saving it to a file and then
printing the file. It actually woks on wxPython 2.5.2.2, I don't
expect it to work with 2.5.1.5. I imagine that some people will
benefit from this code and I'd be more than happy to give my share to
matplotlib. So please let me know how should I send my code. IF I
should send it :slight_smile: I'll do it tomorrow if everything is OK, I'm
exhausted today.

···

On Fri, 23 Jul 2004 14:25:31 -0500, John Hunter <jdhunter@...4...> wrote:

    > Hello again, I've created some axes, and I'm trying to
    > put some custom Ox tick labels on the axes. I would also
    > like to have different alignments for each tick
    > label. This is the code I'm using (with matplotlib.0.61.0a
    > on Win32 with the WXAgg backend):

Hi, I thought we had lost you to PyPlot :slight_smile:

Egads, that was a tough one. Every once in a while when developing
I'll make a temporary change in the src code for experimental purposes
and forget to undo it. This is one of those cases. In
matplotlib.axis.XAxis, on or around line 575, find the line that reads

                #tick = self._get_tick(major=True)
                tick = protoTick

and replace it with

                tick = self._get_tick(major=True)

The assignment 'tick = protoTick' was causing all ticks to share
properties.

FYI, matplotlib has a fairly general and extensible tick locator and
formatter framework, which you can read about in
http://matplotlib.sf.net/matplotlib.ticker.html and in the examples
custom_ticker1.py, major_minor_demo1.py and major_minor_demo2.py in
the matplotlib src distribution or at
http://matplotlib.sf.net/examples. The set_ticks, set_ticklabels,
etc, commands are just wrappers for these classes.

JDH

--
Bogdan