Re: [Matplotlib-users] basic understanding of plotting dates

2007-09-05 Thread Eric Firing
C M wrote: > > > > x = [1,2,3] > > y = [10,20,30] > > self.subplot.plot(x, y) > > I don't understand--where did "self" come from? > > > Sorry--"self" here refers to an instance of a wxPanel class in my > wxPython app. > It is the parent window for the mpl subplot which is

Re: [Matplotlib-users] basic understanding of plotting dates

2007-09-05 Thread C M
> x = [1,2,3] > > y = [10,20,30] > > self.subplot.plot(x, y) > > I don't understand--where did "self" come from? Sorry--"self" here refers to an instance of a wxPanel class in my wxPython app. It is the parent window for the mpl subplot which is meant to be a child of it. The subplot is itself a

Re: [Matplotlib-users] basic understanding of plotting dates

2007-09-05 Thread Eric Firing
C M wrote: [...] > So basically I need to use plot_date but in a figure embedded in a > wxPython app. > Still not sure how this should be written. To make it simple, this > plot() command > works in my app already: > > x = [1,2,3] > y = [10,20,30] > self.subplot.plot(x, y) I don't understand--

Re: [Matplotlib-users] basic understanding of plotting dates

2007-09-05 Thread Mark Bakker
Hey Che - If you include your graphs in a wxPython app, you shouldn't use pylab. Pylab is a wrapper to (quickly) generate graphs, and is very useful, especially in interactive mode, as it saves a lot of typing and is much easier to understand (indeed, a lot like matlab plotting). But for inclusion

Re: [Matplotlib-users] basic understanding of plotting dates

2007-09-05 Thread C M
On 9/4/07, Eric Firing <[EMAIL PROTECTED]> wrote: > > C M wrote: > > I realize that the clearer question (and one which ties into my original > > thread) is: do I need pylab to do plot_date()? > > No, plot_date is available as an axes method. Most pylab plotting > commands are thin wrappers for a

Re: [Matplotlib-users] basic understanding of plotting dates

2007-09-04 Thread Eric Firing
C M wrote: > I realize that the clearer question (and one which ties into my original > thread) is: do I need pylab to do plot_date()? No, plot_date is available as an axes method. Most pylab plotting commands are thin wrappers for axes methods. Eric -

Re: [Matplotlib-users] basic understanding of plotting dates

2007-09-04 Thread Eric Firing
C M wrote: > Mark, Mark, Brendan, John, thanks for the input. I have a related > question that may help to continue to clear things up for me. My goal > is to use matplotlib with wxPython, and I've been able to embed graphs > in wxPython apps fine so far (in this case, directly, not using wxMP

Re: [Matplotlib-users] basic understanding of plotting dates

2007-09-04 Thread C M
I realize that the clearer question (and one which ties into my original thread) is: do I need pylab to do plot_date()? On 9/4/07, C M <[EMAIL PROTECTED]> wrote: > > Mark, Mark, Brendan, John, thanks for the input. I have a related > question that may help to continue to clear things up for me.

Re: [Matplotlib-users] basic understanding of plotting dates

2007-09-04 Thread C M
Mark, Mark, Brendan, John, thanks for the input. I have a related question that may help to continue to clear things up for me. My goal is to use matplotlib with wxPython, and I've been able to embed graphs in wxPython apps fine so far (in this case, directly, not using wxMPL). What I wanted to

Re: [Matplotlib-users] basic understanding of plotting dates

2007-09-04 Thread Brendan Barnwell
Bill Dandreta wrote: >>>C M wrote: >> 1. What exactly must I import (which modules) and how do I import them >> (in the sense of "import x" vs. "from x import y")? >> 2. What arguments does the plot_date() command take and what is format >> of the arguments? >> 3. Do I have to make the conversion f

Re: [Matplotlib-users] basic understanding of plotting dates

2007-09-04 Thread John Hunter
On 9/4/07, Brendan Barnwell <[EMAIL PROTECTED]> wrote: > Incidentally, is there a reason why matplotlib can't just handle > datetime > objects itself? The requirement of having to manually convert them to an > ad-hoc > matplotlib "format" (which is just an integer) seems rather obtuse.

Re: [Matplotlib-users] basic understanding of plotting dates

2007-09-04 Thread Mark Bakker
Maybe this will get you going: import pylab as p import datetime as d from matplotlib.dates import DateFormatter t = [ d.datetime (2007,9,1,12), d.datetime(2007,9,2,12), d.datetime(2007,9,3,12) ] t = p.date2num(t) p.plot_date( t, [10,20,30] ) p.xticks(t) y = DateFormatter('%Y-%m-%d') p.gca().xaxis

Re: [Matplotlib-users] basic understanding of plotting dates

2007-09-04 Thread Bill Dandreta
>>C M wrote: > 1. What exactly must I import (which modules) and how do I import them > (in the sense of "import x" vs. "from x import y")? > 2. What arguments does the plot_date() command take and what is format > of the arguments? > 3. Do I have to make the conversion from the date format above t