From: Friedrich R. <fri...@gm...> - 2010-04-17 17:08:40
|
2010/4/15 KrishnaPribadi <Kri...@ha...>: > Is there any way to just turn > off the exponent number in the right corner and force the x tick labels to > be integers or floating point depending on how close one is zoomed? Have a look at matplotlib/ticker.py. Most classes in ticker.py are derived from class ticker.TickHelper. This in turn has a method .set_axis(). So I think when you write your own formatter class, you should be able to make use of this, because I guess it's called upon attachment of the formatter to the axis, by the axis instance it's attached to. This means, you should be able to retrieve the view limits from the .axis attribute during __call__() of the formatter, so you can choose the format used appropriate according to the view span. Maybe, just as a thought, you should also have a look at the Locator class you're using, to find out how the decision is made, when to use integer tick positions and when to use fp ones. I think you should derive your formatter class from class ticker.Formatter. hth, Friedrich |