From: John H. <jdh...@ac...> - 2006-03-30 15:04:56
|
>>>>> "Darren" == Darren Dale <dd...@co...> writes: Darren> I dont think that can work, since Darren> set_xticklabels(['foo',...]) makes its own call to Darren> set_text('foo'). ax.set_xticklabels calls ax.xaxis.set_ticklabels which creates a new Formatter with self.set_major_formatter( FixedFormatter(ticklabels) ) ticklabels are kind of funny, and this is related to the question on the user's list about setting the location of ticklabels. The location and string are determined at draw time by the Locator and Formatter class, which is why well-intentioned but naive attempts to control their location and text directly often fail. One has to set the locator and formatter, and this is highly configurable and customizable. For the most part, I think it works fine. The one use case brought up on the users list that the framework doesn't address is the "centering" issue of ticklabels, trying to get the labels centered between ticks. I'm mostly -1 on this, and I think the major/minor hack I suggested can solve this use case fairly cleanly, but I'm open to counter arguments. What might be nice, however, is to add a padx, pady properties to text instances in general or maybe just ticklabels in specific, that will shift their horizontal and vertical position by a fixed amount in points. JDH |