[Tutor] question about pylab
shawn bright
nephish at gmail.com
Tue Oct 31 15:45:39 CET 2006
ok, looks like the date2num() function on a datetime.datetime object is
working. So cool.
i am very new at this, so i may be back ( read probably be back ). Thanks
much for the tips.
i appreciate it a lot.
sk
On 10/31/06, Kent Johnson <kent37 at tds.net> wrote:
>
> shawn bright wrote:
> > hey there,
> > i am trying to use a graph and chart app called matplotlib, but i cannot
> > figgure out how to have it plot a simple chart over time.
> > the docs say to use the function plot_date() but i cannot seem to get
> > the values to agree.
> > I am sending datetimes to the charting app for x, and the y is a list of
> > values that the our equipment reports.
> > sometimes there are lots of reports in a row, and i would like the chart
> > to show it like that instead of plotting out every time as an evenly
> > spaced tick on the x scale. Does this make any sense, what i am after
> > here? Anyway, if any of you have much experience with this sort of
> > thing, or may suggest a package (pylab is my first attempt) please send
> > me some advice.
>
> I have used pylab to create a scatterplot of date vs value. The date
> values were created by calling pylab.date2num() on a datetime.datetime
> value. The axes were set up with this code:
>
> # Set up the xaxis
> ax = axes([0.05, 0.05, 0.9, 0.9])
>
> ax.xaxis.set_major_locator(MinuteLocator(interval=10))
> ax.xaxis.set_minor_locator(MinuteLocator())
> ax.xaxis.set_major_formatter(DateFormatter("%H:%M"))
>
>
> I called pylab.scatter() to create the plot.
>
> HTH,
> Kent
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061031/86a396df/attachment.htm
More information about the Tutor
mailing list