From: Peter G. <pgr...@ge...> - 2004-10-14 23:45:41
|
John Hunter wrote: >>>>>>"Peter" == Peter Groszkowski <pgr...@ge...> writes: >>>>>> > > >> also in 0.60.2 i noticed that ticker.DayMultiLocator is used > >> on line 1518 of matplotlib/axes.py but is not imported > > Peter> That was just after DayMultiLocator was added; it's a > Peter> bug. You can just add it yourself. I use (a little > Peter> modified) 60.2 as well on two production servers. It seems > Peter> very stable at this point. Great majority of my plotting > Peter> uses plot_date and with the new changes (haven't tried - > Peter> just read about) I am afraid that lots of my code will > Peter> break. So might take this opportunity to ask: > >My apologies for the hassle. > No need. Evolution... > I suspect you'll find the conversion >painless when/if you can ever work yourself up to it. I converted all >the datetime example code in a matter of minutes > > 1) convert your epoch to proleptic gregorian dates(see below) > > 2) remove the converter instance from the calls to plot_date > > 3) check your tick locator constructors replacing all 'base' > constructors with explicit constructors (expect for the > YearLocator, which still take the base arg). Eg if you want even > months, do MonthLocator(range(2,13,2)) rather than MonthLocator(2) > > sounds straight forward.. > >import matplotlib.numerix as nx >from matplotlib.dates import num2date > >def epoch2num(e): > spd = 24.*3600. > return 719163 + nx.asarray(e)/spd > >e = range(0,20000,1000) >d = epoch2num(e) > >print num2date(d[0]) > >If everyone is happy with the conversion function name and >implementation, I'll add it to the dates module. > epoch2num() looks good to me.. i usually deal with large data sets (often >500k points) and the conversion still seems very quick with Numeric. Will try to upgrade within next couple of weeks. Thanks Peter P.S So when can we see your daughter join the matplotlib development? Judging from your usual responses to our questions/requests, I bet it's sometime real soon. -- Peter Groszkowski Gemini Observatory Tel: +1 808 974-2509 670 N. A'ohoku Place Fax: +1 808 935-9235 Hilo, Hawai'i 96720, USA |