From: John H. <jdh...@ac...> - 2004-04-26 16:45:41
|
>>>>> "H=E9ctor" =3D=3D H=E9ctor Villafuerte D <hec...@te...= m.gt> writes: H=E9ctor> Thanks John, everything works right now, except for fact H=E9ctor> that I need to "clear" it on every iteration ... and the H=E9ctor> line where I try to clear the previous figure H=E9ctor> ("ax.clear()") is giving me troubles. Thanks in advance! When you call subplot(1,1,1) it will return the previously defined one and not create a new one. This is useful in interactive mode if you want to switch between active subplots. Since all command work on the active axes, you need a way to switch between them. For repeatedly drawing figures in a loop, I recommend for tel in tels: figure(1) ...plot... close(1) rather than using clear. However, it does not appear from your traceback that clear is directly causing the problem. You are getting an overflow error on the call to log10(d) where d is the datalim distance. It might be useful to check your datum and vals ranges to make sure they are what you think they are and not some obscenely large number. What happens if you do converter =3D PyDatetimeConverter() e =3D [converter.epoch(thisd) for thisd in datum] print 'date range', min(e), max(e) print 'val range', min(vals), max(vals) before the call to plot_date? In any case, I think it better to return no ticks and warn rather than die, so I've changed the ld =3D log10(d) line in matplotlib.ticker.AutoLocator.get_locator to try: ld =3D log10(d) except OverflowError: print >> sys.stderr, 'AutoLocator illegal datalim range %= s; returning NullLocator'%d return NullLocator() You may want to try this after checking the above. Let me know how it goes. JDH |