You can subscribe to this list here.
2003 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}
(3) 
_{Jun}

_{Jul}

_{Aug}
(12) 
_{Sep}
(12) 
_{Oct}
(56) 
_{Nov}
(65) 
_{Dec}
(37) 

2004 
_{Jan}
(59) 
_{Feb}
(78) 
_{Mar}
(153) 
_{Apr}
(205) 
_{May}
(184) 
_{Jun}
(123) 
_{Jul}
(171) 
_{Aug}
(156) 
_{Sep}
(190) 
_{Oct}
(120) 
_{Nov}
(154) 
_{Dec}
(223) 
2005 
_{Jan}
(184) 
_{Feb}
(267) 
_{Mar}
(214) 
_{Apr}
(286) 
_{May}
(320) 
_{Jun}
(299) 
_{Jul}
(348) 
_{Aug}
(283) 
_{Sep}
(355) 
_{Oct}
(293) 
_{Nov}
(232) 
_{Dec}
(203) 
2006 
_{Jan}
(352) 
_{Feb}
(358) 
_{Mar}
(403) 
_{Apr}
(313) 
_{May}
(165) 
_{Jun}
(281) 
_{Jul}
(316) 
_{Aug}
(228) 
_{Sep}
(279) 
_{Oct}
(243) 
_{Nov}
(315) 
_{Dec}
(345) 
2007 
_{Jan}
(260) 
_{Feb}
(323) 
_{Mar}
(340) 
_{Apr}
(319) 
_{May}
(290) 
_{Jun}
(296) 
_{Jul}
(221) 
_{Aug}
(292) 
_{Sep}
(242) 
_{Oct}
(248) 
_{Nov}
(242) 
_{Dec}
(332) 
2008 
_{Jan}
(312) 
_{Feb}
(359) 
_{Mar}
(454) 
_{Apr}
(287) 
_{May}
(340) 
_{Jun}
(450) 
_{Jul}
(403) 
_{Aug}
(324) 
_{Sep}
(349) 
_{Oct}
(385) 
_{Nov}
(363) 
_{Dec}
(437) 
2009 
_{Jan}
(500) 
_{Feb}
(301) 
_{Mar}
(409) 
_{Apr}
(486) 
_{May}
(545) 
_{Jun}
(391) 
_{Jul}
(518) 
_{Aug}
(497) 
_{Sep}
(492) 
_{Oct}
(429) 
_{Nov}
(357) 
_{Dec}
(310) 
2010 
_{Jan}
(371) 
_{Feb}
(657) 
_{Mar}
(519) 
_{Apr}
(432) 
_{May}
(312) 
_{Jun}
(416) 
_{Jul}
(477) 
_{Aug}
(386) 
_{Sep}
(419) 
_{Oct}
(435) 
_{Nov}
(320) 
_{Dec}
(202) 
2011 
_{Jan}
(321) 
_{Feb}
(413) 
_{Mar}
(299) 
_{Apr}
(215) 
_{May}
(284) 
_{Jun}
(203) 
_{Jul}
(207) 
_{Aug}
(314) 
_{Sep}
(321) 
_{Oct}
(259) 
_{Nov}
(347) 
_{Dec}
(209) 
2012 
_{Jan}
(322) 
_{Feb}
(414) 
_{Mar}
(377) 
_{Apr}
(179) 
_{May}
(173) 
_{Jun}
(234) 
_{Jul}
(151) 
_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

S  M  T  W  T  F  S 







1
(11) 
2

3
(6) 
4
(19) 
5
(20) 
6
(3) 
7
(9) 
8
(1) 
9
(1) 
10
(8) 
11
(4) 
12
(15) 
13
(6) 
14
(14) 
15
(3) 
16
(3) 
17
(2) 
18
(9) 
19
(11) 
20
(26) 
21
(12) 
22
(2) 
23
(6) 
24
(9) 
25
(6) 
26
(16) 
27
(13) 
28
(4) 
29

30
(3) 






From: Steve Schmerler <elcorto@gm...>  20070905 20:51:36

Robert Dailey wrote: > Hi, > > I have two questions: > > 1) Is there any way to represent vectors? Currently I'm using 'array' for > vectors. > I suppose you mean vectors in the Matlab way? Then you should have a look at http://scipy.org/NumPy_for_Matlab_Users#heade9a492daa18afcd86e84e07cd2824a9b1b651935 In short: of course you can do all linalg with numpy.array. With numpy.matrix, some operations (like dot products) can be written more conveniently. > 2) Is there a way to calculate the magnitude (length) of a vector? > a = array([3,1,4]) len(a) a.size # only for a rank1 array a.shape[0] For some basics on numpy, you may also check out: http://scipy.org/Documentation HTH  cheers, steve I love deadlines. I like the whooshing sound they make as they fly by.  Douglas Adams 
From: Eric Firing <efiring@ha...>  20070905 19:50:02

Hal Huntley wrote: > I'm a sys admin trying to install the matplotlib python package for someone > on our staff. I'm not overly familar with python. > > We are trying to use matplotlib with pylab. > > uname a > Linux andromeda 2.6.131.1532_FC4smp #1 SMP Thu Oct 20 01:51:51 EDT 2005 > i686 i686 i386 GNU/Linux > > The python version we have is the default that we got with the Fedora Core 4 > package. > > python V > Python 2.4.1 > > I've installed using /usr/bin/easy_install: > matplotlib0.90.1py2.4win32.egg numpy1.0.3.1py2.4win32.egg I've never understood eggs and easy_install, but it certainly doesn't look right that you are installing things labelled "win32" on a Linux box! I'm surprised you got that far. For linux, I like to install from source, since the distro packages for numpy and mpl are usually too old. If you get the tarballs, build and install numpy first, then mpl. You don't need or want Numeric or numarray. The build process may fail. If it does, it is because you need to install distro packages with headers for various libraries, and you should be able to see from the failures which headers are missing. Maybe someone else can provide more detailed instructions for Fedora C4. Eric > > If we get in to python and give the command: >>>> from pylab import * > > We get: > == > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File > "/usr/lib/python2.4/sitepackages/matplotlib0.90.1py2.4win32.egg/pylab.py", line 1, in ? > from matplotlib.pylab import * > File > "/usr/lib/python2.4/sitepackages/matplotlib0.90.1py2.4win32.egg/matplotlib/pylab.py", line 201, in ? > import mlab #so I can override hist, psd, etc... > File > "/usr/lib/python2.4/sitepackages/matplotlib0.90.1py2.4win32.egg/matplotlib/mlab.py", line 64, in ? > import nxutils > File > "/usr/lib/python2.4/sitepackages/matplotlib0.90.1py2.4win32.egg/matplotlib/nxutils.py", line 17, in ? > from matplotlib._ns_nxutils import * > File > "/usr/lib/python2.4/sitepackages/matplotlib0.90.1py2.4win32.egg/matplotlib/_ns_nxutils.py", line 7, in ? > __bootstrap__() > File > "/usr/lib/python2.4/sitepackages/matplotlib0.90.1py2.4win32.egg/matplotlib/_ns_nxutils.py", line 5, in __bootstrap__ > del __bootstrap__, __loader__ > NameError: global name '__loader__' is not defined > == > > I've read that numeric may need to be installed, so I got "Numeric24.2" > and did: > python setup.py build > python setup.py install > > That didn't help solve the issue. > > Is there some other package that needs to be installed? I checked the FAQ > and this issue does not seem to be there. > > Regards, > > Hal Huntley > SRI International > >  > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers 
From: Eric Firing <efiring@ha...>  20070905 19:05:56

C M wrote: > > > > x = [1,2,3] > > y = [10,20,30] > > self.subplot.plot(x, y) > > I don't understandwhere 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 child of a Figure, so the creation is like this: > > self.figure = Figure(None, dpi) > self.subplot = self.figure.add_subplot(111) add_subplot makes an Axes instance and puts it in the Figure instance; self.subplot is this Axes instance, as I had guessed. So, you can apply any Axes method to it. Eric 
From: Hal Huntley <hal@so...>  20070905 19:02:16

I'm a sys admin trying to install the matplotlib python package for someone on our staff. I'm not overly familar with python. We are trying to use matplotlib with pylab. uname a Linux andromeda 2.6.131.1532_FC4smp #1 SMP Thu Oct 20 01:51:51 EDT 2005 i686 i686 i386 GNU/Linux The python version we have is the default that we got with the Fedora Core 4 package. python V Python 2.4.1 I've installed using /usr/bin/easy_install: matplotlib0.90.1py2.4win32.egg numpy1.0.3.1py2.4win32.egg If we get in to python and give the command: >>> from pylab import * We get: == Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/sitepackages/matplotlib0.90.1py2.4win32.egg/pylab.py", line 1, in ? from matplotlib.pylab import * File "/usr/lib/python2.4/sitepackages/matplotlib0.90.1py2.4win32.egg/matplotlib/pylab.py", line 201, in ? import mlab #so I can override hist, psd, etc... File "/usr/lib/python2.4/sitepackages/matplotlib0.90.1py2.4win32.egg/matplotlib/mlab.py", line 64, in ? import nxutils File "/usr/lib/python2.4/sitepackages/matplotlib0.90.1py2.4win32.egg/matplotlib/nxutils.py", line 17, in ? from matplotlib._ns_nxutils import * File "/usr/lib/python2.4/sitepackages/matplotlib0.90.1py2.4win32.egg/matplotlib/_ns_nxutils.py", line 7, in ? __bootstrap__() File "/usr/lib/python2.4/sitepackages/matplotlib0.90.1py2.4win32.egg/matplotlib/_ns_nxutils.py", line 5, in __bootstrap__ del __bootstrap__, __loader__ NameError: global name '__loader__' is not defined >>> == I've read that numeric may need to be installed, so I got "Numeric24.2" and did: python setup.py build python setup.py install That didn't help solve the issue. Is there some other package that needs to be installed? I checked the FAQ and this issue does not seem to be there. Regards, Hal Huntley SRI International 
From: C M <cmpython@gm...>  20070905 18:24:55

> x = [1,2,3] > > y = [10,20,30] > > self.subplot.plot(x, y) > > I don't understandwhere 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 child of a Figure, so the creation is like this: self.figure = Figure(None, dpi) self.subplot = self.figure.add_subplot(111) If we assume that self.subplot is in fact an axes instance, then you can > use > self.subplot.plot_date(...), where the arguments would be the same as if > you were using pylab.plot_date(...). Is it? How is Figure() related to axes? Maybe it would also help for you to look at dates.py (one of the mpl > modules)? I will try; so far, when I try to adapt the examples given in this thread to an wx embedded app it is not working... Thanks, Che 
From: Patrick Bradley <patrick.bradley@gm...>  20070905 18:20:53

Never mind  I missed a key point in the documentation. For anyone who's wondering: lg = legend() lg.get_frame().set_facecolor('black') works fine. Patrick On 9/5/07, Patrick Bradley <patrick.bradley@...> wrote: > > Hi all, > > Can you change the background of the figure legends generated by > matplotlib? I'd like to have some whiteonblack figures for a few > presentations that I'm giving, and I can change the figure and axes > facecolor attributes accordingly (as well as the default text and axis label > colors), but I can't find an option anywhere to change the background of the > legend: it still shows up as a white box. Any ideas? > > Thanks in advance. > > Yours, > Patrick > 
From: Eric Firing <efiring@ha...>  20070905 18:12:52

Ping Yeh wrote: > 2007/9/5, Eric Firing <efiring@...>: >> Ping Yeh wrote: >> [snip] >>> If there is no existing modules for this I'll go ahead write one. :) >> There is nothing quite like this. As a starting point, though, you >> should become familiar with the ability of numpy to handle record >> arrays; your table data type sounds like a numpy record array. >> Matplotlib is a plotting library built on the numpy Ndimensional array >> library. >> >> Eric >> > > Hi Eric, > > Thanks for the info. I searched for the numpy record array and it is > indeed very close to what I want for the data storage! Thanks! > > Just one quick question, though (I admit I don't have much experience > with numpy...). Can a record array store string data? I'll have some > of these in the attribute data, not used for plotting but needed for > other purposes. Yes. Here is an example: In [27]:dd1 = numpy.dtype({'names': ['x', 'y', 'i', 'comment'], 'formats': ['<f8', '<f8', '<i4', 'S20']}) In [28]:xx = numpy.array([(1.1, 2.2, 1, 'first'), (1.2, 2.3, 2, 'second')], dtype=dd1) In [29]:xx Out[29]: array([(1.1000000000000001, 2.2000000000000002, 1, 'first'), (1.2, 2.2999999999999998, 2, 'second')], dtype=[('x', '<f8'), ('y', '<f8'), ('i', '<i4'), ('comment', 'S20')]) In [30]:xx['x'] Out[30]:array([ 1.1, 1.2]) In [31]:xx['comment'] Out[31]: array(['first', 'second'], dtype='S20') There is one nonobvious thing to note: in line 28, each record must be a *tuple*, not a *list*. Note also that you must allow enough space for the maximum length of string. Alternatively, the strings can be stored as objects: In [32]:dd2 = numpy.dtype({'names': ['x', 'y', 'i', 'comment'], 'formats': ['<f8', '<f8', '<i4', 'O']}) In [33]:xx = numpy.array([(1.1, 2.2, 1, 'first'), (1.2, 2.3, 2, 'second')], dtype=dd2) In [34]:xx['comment'] Out[34]:array([first, second], dtype=object) In [35]:xx['x'] Out[35]:array([ 1.1, 1.2]) Eric 
From: Patrick Bradley <patrick.bradley@gm...>  20070905 17:59:36

Hi all, Can you change the background of the figure legends generated by matplotlib? I'd like to have some whiteonblack figures for a few presentations that I'm giving, and I can change the figure and axes facecolor attributes accordingly (as well as the default text and axis label colors), but I can't find an option anywhere to change the background of the legend: it still shows up as a white box. Any ideas? Thanks in advance. Yours, Patrick 
From: Robert Dailey <rcdailey@gm...>  20070905 17:02:08

Hi, I have two questions: 1) Is there any way to represent vectors? Currently I'm using 'array' for vectors. 2) Is there a way to calculate the magnitude (length) of a vector? Thanks. 
From: Ping Yeh <ping.yeh@gm...>  20070905 10:09:36

Hello, Thanks to quick hints/tips from Eric and Lionel, I have a module for conditional plotting and histogramming without defining a table type! It works with numerical arrays quite well, but does not work on string arrays in conditions. I paste the code below since they are quite short. Hope that's not considered spam on this list. :) cheers and thanks, Ping from pylab import * def __prepare(arg): cond = arg[1] indices = find(cond) toplot = [] atype = type(array([0,1])) for vec in arg[:1]: if type(vec) == type(""): toplot.append(vec) if type(vec) == atype: toplot.append(array([vec[i] for i in indices])) return toplot def cplot(*arg, **kw): '''Make a conditional plot. Example: cplot(t, x, y > 3) => a plot of { (t[i],x[i])  y[i] > 3} cplot(x, y > 3) => a plot of { (i,x[i])  y[i] > 3} The condition string can have multiple conditions joined by logical operators &  ^. All keyword arguments are passed intact to plot(). ''' toplot = __prepare(arg) return plot(*toplot, **kw) def chist(*arg, **kw): '''Make a conditional histogram. Example: chist(x, y > 3) => a histogram plot of {x[i]  y[i] > 3} The condition string can have multiple conditions joined by logical operators &  ^. All keyword arguments are passed intact to hist(). ''' toplot = __prepare(arg) return hist(*toplot, **kw) def testcplot(): t = arange(0,1.0, 0.01) x = sin(t*2*pi) y = exp(t/0.5) plot(t, x) plot(t, y) cplot(t, x, "o", y<0.2) if __name__ == '__main__': testcplot() 
From: Xavier Gnata <gnata@ob...>  20070905 10:05:28

Eric Firing wrote: > Xavier Gnata wrote: >> Hi all, >> >> I looking for a way to modify the colorbar ticks font size. >> a=rand(100,100) >> imshow(a) >> colorbar() >> and then?? >> >> For instance, xticks(fontsize=20) works well to modify the ticks >> fontsize along the Xaxis but colorbar(fontsize=20) does not exists. >> I must be missing something. > > cb = colorbar() # grab the Colorbar instance > for t in cb.ax.get_yticklabels(): > t.set_fontsize(20) > > The colorbar function makes a new axes object, the "ax" attribute of > the Colorbar instance returned by the colorbar function. From that > you get the list of text objects, which you then modify. > > The pylab xticks and yticks functions make the retrieval and > modification of the text objects easier, but they operate only on the > "current axes", and the colorbar leaves the image axes as current. > > An alternative method is to change the current axes: > > imaxes = gca() > axes(cb.ax) > yticks(fontsize=20) > axes(imaxes) > > > Here I saved and restored the original axes in case you want to do > something with the image axes after modifying the colorbar. > > Eric > Hi, Your first method is not working on my box (no change) but the second one is just fine :) However, it is not as intuitive as other matplotlib ways of doing things. Is there a simple way to modify the colorbar code to get something like colorbar(fontsize=20) work ? Or maybe as a method like that : cb=colorbar() cb.set_fontsize(20) Any comments ? Xavier  ############################################ Xavier Gnata CRAL  Observatoire de Lyon 9, avenue Charles André 69561 Saint Genis Laval cedex Phone: +33 4 78 86 85 28 Fax: +33 4 78 86 83 86 Email: gnata@... ############################################ 
From: Andres Luhamaa <andres.luhamaa@ut...>  20070905 09:48:27

Hi all! I'm new to matplotlib so please excuse me, if this is a bit too simple problem. I'm trying to animate simple plot using example anim.py It works well when I just write functions as follows: def joonista(x): line, = p.plot(ala, x) p.draw() time.sleep(0.1) def lpc(x): x2=empty(real(ap)) for t in range(maxt): x2[alg]=x[alg+1] x2[ap1]=x[alg] for k in range(alg+1,ap1): x2[k]=x[k+1] x=x2 joonista(x2) but when I write the functions in a more general way and define an additional function "lpc1" to make some calculation, like this: def joonista(x): line, = p.plot(ala, x) p.draw() time.sleep(0.1) def lpc(x): x2=empty(real(ap)) for t in range(maxt): x2=lpc1(x) x=x2 joonista(x2) def lpc1(x): x2=empty(real(ap)) x2[alg]=x[alg+1] x2[ap1]=x[alg] for k in range(alg+1,ap1): x2[k]=x[k+1] return x2 the animation still works, but the plot does not clear itself at all, meaning that all the lines it draws stay there until the end. I'm using matplotlib version 0.87.1 which comes with ubuntu. The full code is added in the end. So is this expected behavior and I should make the code in a different way or what? I could try to upgrade to newer version of matplotlib if that could be useful. Regards, Andres The full program code: #!/usr/bin/env python import pylab as p from numpy import * import time def joonista(x): line, = p.plot(ala, x) p.draw() time.sleep(0.1) def gaussikover(): for i in ala: x[i]=math.exp((iap2)**2./a) return x def lpc(x): x2=empty(real(ap)) for t in range(maxt): ## x2[alg]=x[alg+1] ## x2[ap1]=x[alg] ## for k in range(alg+1,ap1): ## x2[k]=x[k+1] x2=lpc1(x) x=x2 joonista(x2) def lpc1(x): x2=empty(real(ap)) x2[alg]=x[alg+1] x2[ap1]=x[alg] for k in range(alg+1,ap1): x2[k]=x[k+1] return x2 p.ion() alg=0 ap=100 ap2=ap/2 x=empty(real(ap)) a=70. maxt=20 ala=range(ap) x=gaussikover() lpc(x) 
From: Ping Yeh <ping.yeh@gm...>  20070905 08:42:42

Hi Lionel, Thanks for the tips. The histogram plot I need can be done by hist(x). :) I tried your commands and I like the find() function! However, xi = x[ind] failed with an "IndexError: invalid index". The same operation can be done with xi = array([x[i] for i in ind]) but if a numpy function can do that it may be faster for large arrays. cheers, Ping 2007/9/5, Lionel Roubeyrie <lroubeyrie@...>: > Hi Ping, > don't know if it could help you : > > from pylab import * > > > d = Table("xyt.dat") > x,y,t = load("xyt.dat", unpack=true) > > > d.plot("x", "t") # make a plot of x vs. t, N points are drawn > plot(t, x) > > > d.plot("x") # make a histogram plot of x, N entries in the histogram > bar(range(len(x)), x) > > > d.plot("x", "y < 3") # make a histogram plot of x where y is less than 3. > ind = find(y < 3) > xi = x[ind] > bar(range(len(xi)), xi) > > Cheers > > >  > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers > 
From: Ping Yeh <ping.yeh@gm...>  20070905 08:33:23

2007/9/5, Eric Firing <efiring@...>: > Ping Yeh wrote: > [snip] > > > > If there is no existing modules for this I'll go ahead write one. :) > > There is nothing quite like this. As a starting point, though, you > should become familiar with the ability of numpy to handle record > arrays; your table data type sounds like a numpy record array. > Matplotlib is a plotting library built on the numpy Ndimensional array > library. > > Eric > Hi Eric, Thanks for the info. I searched for the numpy record array and it is indeed very close to what I want for the data storage! Thanks! Just one quick question, though (I admit I don't have much experience with numpy...). Can a record array store string data? I'll have some of these in the attribute data, not used for plotting but needed for other purposes. Thanks, Ping 
From: Lionel Roubeyrie <lroubeyrie@li...>  20070905 07:50:23

Hi Ping, don't know if it could help you : from pylab import * > d = Table("xyt.dat") x,y,t = load("xyt.dat", unpack=true) > d.plot("x", "t") # make a plot of x vs. t, N points are drawn plot(t, x) > d.plot("x") # make a histogram plot of x, N entries in the histogram bar(range(len(x)), x) > d.plot("x", "y < 3") # make a histogram plot of x where y is less than 3. ind = find(y < 3) xi = x[ind] bar(range(len(xi)), xi) Cheers 
From: Eric Firing <efiring@ha...>  20070905 07:46:36

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 understandwhere did "self" come from? If we assume that self.subplot is in fact an axes instance, then you can use self.subplot.plot_date(...), where the arguments would be the same as if you were using pylab.plot_date(...). All this might be clarified if you look at the code for pylab.plot and pylab.plot_date. I may be missing something; I was not paying attention to earlier parts of this thread, I haven't done much with dates and have never used plot_date myself, and I have no experience with embedding. Maybe it would also help for you to look at dates.py (one of the mpl modules)? Eric > > So, my question is, how would this be modified for a wx app (that is, no > pylab > allowed) and use plot_date()? Assume my dates are as given below. > > dates (x axis): > 090107 12:00:02 > 090207 12:00:04 > 090307 12:00:06 > > values (y axis): > 10 > 20 > 30 > > The examples that Bill and Mark gave above in the list showed how to do > this using pylab, but I just need the simplest example and one which does > not use pylab. > > Thanks, > Che > 
From: Mark Bakker <markbak@gm...>  20070905 07:45:34

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 in apps you need to use matplotlib, so you are on the right track. This has been discussed several times on the list, but it may not be so easy to find. Maybe we should put this on the FAQ page (or maybe it is already there!), Mark On 9/4/07, C M <cmpython@...> 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 wxMPL). What I wanted > to know is whether it is necessary to use pylab or not. I am a little > unclear what the purpose of pylab is in distinction to matplotlib itself. I > gather that pylab is a way to sort of emulate Matlab, but I am unclear as to > whether I need to be using pylab in my apps or not. I am not doing > scientific plots, just fairly simple graphs, though I may throw some > regression lines and r values on there at some point. > > I really just want to keep things as simple as possible, and if I don't > need to use pylab, I'd rather not. Any insight would be helpful. Thank > you. > Che M > > On 9/4/07, Mark Bakker <markbak@...> wrote: > > > > 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.set_major_formatter(y) > > p.draw() > > > > Mark > > > > From: "C M" <cmpython@...> > > > Subject: [Matplotlibusers] basic understanding of plotting dates > > > > > > x = (20070901 12:00:02, 20070902 12:00:02, 20070903 12:00:02) > > > y = (10, 20, 30) > > > > > > > > 
From: Eric Firing <efiring@ha...>  20070905 07:36:21

Ping Yeh wrote: > Hi, > > I checked the manual and briefly searched the mailing list but did not > find this... Is there a tablelike data type with rows as events and > columns as attributes that I can make plots with? This is called > "ntuple" in the high energy physics community. > > Let me illustrate with an example. Assume that an event consists of 3 > attributes (x, y, t). With N events we have a table of N x 3 data > items. Assume that the data items are read from a file "xyt.dat". > > d = Table("xyt.dat") > d.plot("x", "t") # make a plot of x vs. t, N points are drawn > d.plot("x") # make a histogram plot of x, N entries in the histogram > d.plot("x", "y < 3") # make a histogram plot of x where y is less than 3. > # that is, only {x[i]  y[i] < 3} are used to make the histogram > > If there is no existing modules for this I'll go ahead write one. :) There is nothing quite like this. As a starting point, though, you should become familiar with the ability of numpy to handle record arrays; your table data type sounds like a numpy record array. Matplotlib is a plotting library built on the numpy Ndimensional array library. Eric 
From: Ping Yeh <ping.yeh@gm...>  20070905 07:18:47

Hi, I checked the manual and briefly searched the mailing list but did not find this... Is there a tablelike data type with rows as events and columns as attributes that I can make plots with? This is called "ntuple" in the high energy physics community. Let me illustrate with an example. Assume that an event consists of 3 attributes (x, y, t). With N events we have a table of N x 3 data items. Assume that the data items are read from a file "xyt.dat". d = Table("xyt.dat") d.plot("x", "t") # make a plot of x vs. t, N points are drawn d.plot("x") # make a histogram plot of x, N entries in the histogram d.plot("x", "y < 3") # make a histogram plot of x where y is less than 3. # that is, only {x[i]  y[i] < 3} are used to make the histogram If there is no existing modules for this I'll go ahead write one. :) cheers, Ping 
From: C M <cmpython@gm...>  20070905 07:00:31

On 9/4/07, Eric Firing <efiring@...> 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 axes methods. Thanks for your help in clearing this up and the uses of pylab. 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) So, my question is, how would this be modified for a wx app (that is, no pylab allowed) and use plot_date()? Assume my dates are as given below. dates (x axis): 090107 12:00:02 090207 12:00:04 090307 12:00:06 values (y axis): 10 20 30 The examples that Bill and Mark gave above in the list showed how to do this using pylab, but I just need the simplest example and one which does not use pylab. Thanks, Che 