Patch for allowing text with dashes as axis tick labels

Please let me know if there are any modifications to the

    > patch which would make it a better candidate for
    > incorporation into the mainline source.

Hey Daishi,

That is certainly a nice patch and a funky example -- well done.

I was very pleased to see that you added this as a general text
feature and not a feature of text ticks only. My only suggestions
are: 1) move the dash text class to the text module rather than the axis
module (where it seems to belong since it is a general purpose
connector between a text instance and a point), and 2) provide an example
which uses a generic text instance in addition to the one you provided
using a tick label text instance.

Changes are in CVS -- perhaps you can send me a patch against the
latest revision?

As for the alignment problems (in agg or ps at least), they may be a
result of sf bugs #1194018 and #1177396.

Thanks!
JDH

Hi John,

I've uploaded some new files to sourceforge.

My only suggestions
are: 1) move the dash text class to the text module rather than the axis
module (where it seems to belong since it is a general purpose
connector between a text instance and a point), and

Done. I also slightly modified axes.py to facilitate providing
your suggestion 2).

2) provide an example
which uses a generic text instance in addition to the one you provided
using a tick label text instance.

Please see the new example, which I'm attaching below.
As I note in the script which generated the plot, the various
rotations are meant to show the possibilities, rather than
for visual appeal.

As for the alignment problems (in agg or ps at least), they may be a
result of sf bugs #1194018 and #1177396.

I also think the current rendering when separate rotations for
the text and the dash are specified is suboptimal (I show
examples of this in the new example plot), but the current code
satisfies my immediate use case, so I'm hoping that if/as this
extension gets incorporated into the matplotlib codebase,
others will find that improving the current rotation/transformation
logic will be an itch that they want to scratch.

Thx,
d

ps. FWIW, the last letter in my name is an 'i', not an 'a'.
(I edited the CHANGELOG to reflect this)

dashpointlabel.png

···

On May 26, 2005, at 7:34 PM, John Hunter wrote: