From: John H. <jdh...@ac...> - 2004-07-23 19:49:29
|
>>>>> "Bogdan" == Bogdan Marinescu <bog...@gm...> writes: Bogdan> Hello again, I've created some axes, and I'm trying to Bogdan> put some custom Ox tick labels on the axes. I would also Bogdan> like to have different alignments for each tick Bogdan> label. This is the code I'm using (with matplotlib.0.61.0a Bogdan> on Win32 with the WXAgg backend): Hi, I thought we had lost you to PyPlot :-) 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 |