+ def _xticks(self, *args):
+ if self._logscale[0]:
+ return self._logticks(*args)
+ else:
+ return self._ticks(*args)
+
+ def _yticks(self, *args):
+ if self._logscale[1]:
+ return self._logticks(*args)
+ else:
+ return self._ticks(*args)
+
+ def _logticks(self, lower, upper):
+ #lower,upper = map(_Numeric.log10,[lower,upper])
+ #print 'logticks',lower,upper
+ ticks = []
+ mag = _Numeric.power(10,_Numeric.floor(lower))
+ if upper-lower > 6:
+ t = _Numeric.power(10,_Numeric.ceil(lower))
+ base = _Numeric.power(10,_Numeric.floor((upper-lower)/6))
+ def inc(t):
+ return t*base-t
+ else:
+ t = _Numeric.ceil(_Numeric.power(10,lower)/mag)*mag
+ def inc(t):
+ return 10**int(_Numeric.floor(_Numeric.log10(t)+1e-16))
+ majortick = int(_Numeric.log10(mag))
+ while t <= pow(10,upper):
+ if majortick != int(_Numeric.floor(_Numeric.log10(t)+1e-16)):
+ majortick = int(_Numeric.floor(_Numeric.log10(t)+1e-16))
+ ticklabel = '1e%d'%majortick
+ else:
+ if upper-lower < 2:
+ minortick = int(t/pow(10,majortick)+.5)
+ ticklabel = '%de%d'%(minortick,majortick)
+ else:
+ ticklabel = ''
+ ticks.append((_Numeric.log10(t), ticklabel))
+ t += inc(t)
+ if len(ticks) == 0:
+ ticks = [(0,'')]
+ return ticks
+