You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(15) |
Sep
(21) |
Oct
(15) |
Nov
|
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(7) |
Feb
(6) |
Mar
(2) |
Apr
(5) |
May
(6) |
Jun
(3) |
Jul
(4) |
Aug
(4) |
Sep
(3) |
Oct
(14) |
Nov
(16) |
Dec
(10) |
2004 |
Jan
(5) |
Feb
(10) |
Mar
(4) |
Apr
(8) |
May
(1) |
Jun
(5) |
Jul
(5) |
Aug
(4) |
Sep
(10) |
Oct
(3) |
Nov
(4) |
Dec
|
2005 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
(15) |
May
(12) |
Jun
(1) |
Jul
(4) |
Aug
(3) |
Sep
(6) |
Oct
(7) |
Nov
(21) |
Dec
(11) |
2006 |
Jan
(16) |
Feb
(12) |
Mar
(4) |
Apr
(6) |
May
(5) |
Jun
(9) |
Jul
|
Aug
(5) |
Sep
(1) |
Oct
(10) |
Nov
(4) |
Dec
(3) |
2007 |
Jan
(6) |
Feb
(4) |
Mar
(6) |
Apr
(11) |
May
(1) |
Jun
(21) |
Jul
|
Aug
(6) |
Sep
(2) |
Oct
(4) |
Nov
|
Dec
|
2008 |
Jan
(14) |
Feb
(1) |
Mar
(5) |
Apr
(22) |
May
(4) |
Jun
(1) |
Jul
(7) |
Aug
(5) |
Sep
(7) |
Oct
(3) |
Nov
|
Dec
(1) |
2009 |
Jan
(14) |
Feb
(1) |
Mar
(9) |
Apr
(5) |
May
(6) |
Jun
(7) |
Jul
(8) |
Aug
(3) |
Sep
|
Oct
|
Nov
(2) |
Dec
(4) |
2010 |
Jan
(2) |
Feb
|
Mar
(6) |
Apr
(6) |
May
(34) |
Jun
|
Jul
(8) |
Aug
(3) |
Sep
|
Oct
(5) |
Nov
(3) |
Dec
(1) |
2011 |
Jan
|
Feb
(4) |
Mar
(3) |
Apr
|
May
|
Jun
(5) |
Jul
(9) |
Aug
(5) |
Sep
(9) |
Oct
(3) |
Nov
(10) |
Dec
(1) |
2012 |
Jan
(1) |
Feb
(3) |
Mar
(2) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(3) |
Nov
(2) |
Dec
(9) |
2014 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2016 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael H. <mh...@al...> - 2009-07-08 09:16:02
|
Juana Arco wrote: > I'm trying to save a plot into a stream and call it from a webpage, I > cannot find a way to do it. I don't understand what you want. Would you like the gnuplot commands to be written to a stream, or do you want the gnuplot output (i.e., image files) stored to a stream? The answer might also depend on what operating system you are using... Michael |
From: Juana A. <lua...@ho...> - 2009-07-07 17:55:16
|
Hi, I'm trying to save a plot into a stream and call it from a webpage, I cannot find a way to do it. Thanks, Lua _________________________________________________________________ Lauren found her dream laptop. Find the PC that’s right for you. http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290 |
From: Elias T. <el...@ne...> - 2009-06-11 11:29:39
|
Hello, I want to change the values on x and y axis to appear in a non-symmetric way, e.g. within a range between 0 and 50000 I want to show the following values: 50, 100, 500, 1000, 5000, 10000, 25000. By default the split will be in chunks of 5000, so am missing all the details of the curve between 0 and 5000. thanks, elias |
From: Elias T. <el...@ne...> - 2009-06-11 11:29:37
|
Hello, I want to change the values on x and y axis to appear in a non-symmetric way, e.g. within a range between 0 and 50000 I want to show the following values: 50, 100, 500, 1000, 5000, 10000, 25000. By default the split will be in chunks of 5000, so am missing all the details of the curve between 0 and 5000. thanks, elias |
From: Elias T. <eth...@st...> - 2009-06-11 10:58:45
|
Hello, I want to change the values on x and y axis to appear in a non-symmetric way, e.g. within a range between 0 and 50000 I want to show the following values: 50, 100, 500, 1000, 5000, 10000, 25000. By default the split will be in chunks of 5000, so am missing all the details of the curve between 0 and 5000. thanks, elias -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. |
From: Benny M. <ben...@gm...> - 2009-06-08 07:41:34
|
2009/6/7 Fernando Cladera <el....@gm...>: > There was a bad indented line (t0 = tinicial)... Sorry! > This is the code. I could add the plotting, but i couldn't draw the > surface. Look at the examples in the demo.py file Benny > > def funhomo(x,t): > return > eigenvector[0,0]*cos(wfrec*t)*sin(pi*x/(2*L))+eigenvector[1,0]*cos(wfrec*t)*sin(3*pi*x/(2*L))+eigenvector[2,0]*cos(wfrec*t)*sin(5*pi*x/(2*L)) > > it=int(raw_input("ingrese numero de puntos a obtener: ")) > xinicial=0 > tinicial=0 > hx=float(raw_input("ingrese paso de x: ")) > ht=float(raw_input("ingrese paso de t: ")) > > funclst=[] > x0 = xinicial > t0 = tinicial > for i in range(0,it+1): > x=x0 > for j in range(0,it+1): > t=t0 > f=funhomo(x,t) > t0=t+ht > print x,t,f > funclst.append([x,t,f]) > t0 = tinicial > x0=x+hx > #print funclst > > gp = Gnuplot.Gnuplot(debug=1) > gp.clear() > plot1 = Gnuplot.PlotItems.Data(funclst, with_="points", > title="Superficie") > gp.splot(plot1) > > -- > Fernando Cladera <el....@gm...> > > > ------------------------------------------------------------------------------ > OpenSolaris 2009.06 is a cutting edge operating system for enterprises > looking to deploy the next generation of Solaris that includes the latest > innovations from Sun and the OpenSource community. Download a copy and > enjoy capabilities such as Networking, Storage and Virtualization. > Go to: http://p.sf.net/sfu/opensolaris-get > _______________________________________________ > Gnuplot-py-users mailing list > Gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-py-users > |
From: Alan G I. <ai...@am...> - 2009-06-07 19:03:47
|
On 6/6/2009 11:55 PM Fernando Cladera apparently wrote: > [[0, 0, 0.0], [0, 0, 0.0], [0, 0, 0.0], [1.0, 0, > 3.1415924394448096e-05], [1.0, 0, 3.1415924394448096e-05], [1.0, 0, > 3.1415924394448096e-05], [2.0, 0, 6.2831848757889894e-05], [2.0, 0, > 6.2831848757889894e-05], [2.0, 0, 6.2831848757889894e-05]] > I got a line draw and this > Warning: empty y range [0:0], adjusting to [-1:1]. Which is a remarkably specific and accurate warning. Look at the second element in each data point. Cheers, Alan Isaac |
From: Fernando C. <el....@gm...> - 2009-06-07 04:09:23
|
There was a bad indented line (t0 = tinicial)... Sorry! This is the code. I could add the plotting, but i couldn't draw the surface. def funhomo(x,t): return eigenvector[0,0]*cos(wfrec*t)*sin(pi*x/(2*L))+eigenvector[1,0]*cos(wfrec*t)*sin(3*pi*x/(2*L))+eigenvector[2,0]*cos(wfrec*t)*sin(5*pi*x/(2*L)) it=int(raw_input("ingrese numero de puntos a obtener: ")) xinicial=0 tinicial=0 hx=float(raw_input("ingrese paso de x: ")) ht=float(raw_input("ingrese paso de t: ")) funclst=[] x0 = xinicial t0 = tinicial for i in range(0,it+1): x=x0 for j in range(0,it+1): t=t0 f=funhomo(x,t) t0=t+ht print x,t,f funclst.append([x,t,f]) t0 = tinicial x0=x+hx #print funclst gp = Gnuplot.Gnuplot(debug=1) gp.clear() plot1 = Gnuplot.PlotItems.Data(funclst, with_="points", title="Superficie") gp.splot(plot1) -- Fernando Cladera <el....@gm...> |
From: Fernando C. <el....@gm...> - 2009-06-07 03:52:15
|
Hi everybody! I'm new with gnuplot.py... I'll try not to ask a newbie question... I'm now working on an engineering problem of differential equations. I use numpy and I have to plot a surface, that is the solution of the problem. A piece of code of the project: def funhomo(x,t): return eigenvector[0,0]*cos(wfrec*t)*sin(pi*x/(2*L))+eigenvector[1,0]*cos(wfrec*t)*sin(3*pi*x/(2*L))+eigenvector[2,0]*cos(wfrec*t)*sin(5*pi*x/(2*L)) it=int(raw_input("ingrese numero de puntos a obtener: ")) xinicial=0 tinicial=0 hx=float(raw_input("ingrese paso de x: ")) ht=float(raw_input("ingrese paso de t: ")) funclst=[] x0 = xinicial t0 = tinicial for i in range(0,it+1): x=x0 for j in range(0,it+1): t=t0 f=funhomo(x,t) t0=t+ht #print x,t,f funclst.append([x,t,f]) t0 = tinicial x0=x+hx print funclst As you can see, this piece makes a arrange (funclst) with a list of points (t and x) and the function (funhomo) evaluated in those points. Here, you can see an output, for it=2 and hx=ht=1 [[0, 0, 0.0], [0, 0, 0.0], [0, 0, 0.0], [1.0, 0, 3.1415924394448096e-05], [1.0, 0, 3.1415924394448096e-05], [1.0, 0, 3.1415924394448096e-05], [2.0, 0, 6.2831848757889894e-05], [2.0, 0, 6.2831848757889894e-05], [2.0, 0, 6.2831848757889894e-05]] The first element of each vector is the x. The second, the t (or y in a plot) and the third is the z=funhomo(x,t). I've tried to plot those points with gnuplot.py, but i can't! If i use gp = Gnuplot.Gnuplot(debug=1) gp.clear() gp('set data style lines') gp.splot(funclst) I got a line draw and this Warning: empty y range [0:0], adjusting to [-1:1]. However, i tried to export a "point list" and plot them with gnuplot. But i got a plot of the points, and i don't know how to draw the surface (the mesh between points). Any idea? Thanks! -- Fernando Cladera <el....@gm...> |
From: Alan G I. <ai...@am...> - 2009-05-23 15:57:27
|
> On 5/22/2009 9:13 AM mohsen rahmanian apparently wrote: >> When I use gnuplot-py on windows xp with python 2.5.1 and run demo.py I get this: >> IOError: [Errno 22] Invalid argument On 5/22/2009 5:34 PM Brian Connell apparently wrote: > I saw this problem when a long sequence of gnuplot commands was being passed into another function as a parameter. The IOError was complaining that the parameter was not valid for some reason. Well, out of curiosity, I started from scratch on Win XP: - download Gnuplot.py version 1.8 from sourceforce - install under Python 2.5.4 (setup.py install) - change gp_win32.py to point to my copy of pgnuplot.exe (note the name!) - run demo.py No problems at all. Cheers, Alan Isaac |
From: Alan G I. <ai...@am...> - 2009-05-22 15:18:57
|
On 5/22/2009 9:13 AM mohsen rahmanian apparently wrote: > When I use gnuplot-py on windows xp with python 2.5.1 and run demo.py > I get this: > IOError: [Errno 22] Invalid argument Brian Connell recently ran into this. Hopefully he will post his solution. Alan Isaac |
From: mohsen r. <rah...@gm...> - 2009-05-22 13:13:58
|
His name Dear users, When I use gnuplot-py on windows xp with python 2.5.1 and run demo.py I get this: gnuplot> set terminal windows gnuplot> set title "A simple example" gnuplot> set data style linespoints gnuplot> plot "c:\\docume~1\\ef634~1.pas\\locals~1\\temp\\tmpm5ee2g.gnuplot" notitle Please press return to continue... Traceback (most recent call last): File "C:\Program Files\Paive-1.0\Lib\site-packages\Gnuplot\demo.py", line 110, in <module> demo() File "C:\Program Files\Paive-1.0\Lib\site-packages\Gnuplot\demo.py", line 36, in demo g.reset() File "C:\Program Files\Paive-1.0\lib\site-packages\Gnuplot\_Gnuplot.py", line 366, in reset self('reset') File "C:\Program Files\Paive-1.0\lib\site-packages\Gnuplot\_Gnuplot.py", line 210, in __call__ self.gnuplot(s) File "C:\Program Files\Paive-1.0\lib\site-packages\Gnuplot\gp_win32.py", line 130, in __call__ self.write(s + '\n') IOError: [Errno 22] Invalid argument what is my problem? Thanks a lot -- Best Regards Rahmanian |
From: Alan G I. <ai...@am...> - 2009-05-21 14:26:50
|
On 5/20/2009 6:26 PM Brian Connell apparently wrote: > the persist option is not supported on Windoze. Aha. > I have printed out the script variable passed in, but my > untrained eye can not see a problem. Put it in a file and load it in gnuplot itself to see how gnuplot responds. I'm afraid I'm not currently using Gnuplot.py, so I cannot be much more help. Cheers, Alan Isaac |
From: Alan G I. <ai...@am...> - 2009-05-18 23:18:26
|
You should not need any of your path tweaks. It looks like Gnuplot imports fine. Start up an interactive interpreter. At the interpreter prompt, enter: import Gnuplot What happens? Cheers, Alan Isaac |
From: Brian C. <bdc...@ya...> - 2009-05-18 23:02:11
|
Been trying awhile, read as much as I can (all FAQs, README’s, etc), and need help. Basically I cannot get the ‘import Gnuplot” statement to work in a python script. Details as follows. Working in Windows XP professional. Installed gnuplot.py 1.8, by unzipping to a directory, and from that directory running: python setup.py install When running the setup, got a warning about “licence” being deprecated in favor of “license”; but everything seems to have installed/copied OK. Have the following directory in place now (with the proper capital “G” which was a problem for some): C:\Program Files\Python26\Lib\site-packages\Gnuplot Editted the gp_win32.py file to point to where pgnuplot.exe is located on my PC. Ran all the demo scripts, and got all the demo graphs properly. Assuming gnuplot and numpy installed correctly. Added the sitepackages directory to my PATH. My problem is that when I run a python script that tries to “import Gnuplot” it gets an error. For instance my gpxplot.py script prints out this after trying to import Gnuplot. gnuplot.py is not found Exception AttributeError: "GnuplotProcess instance has no attribute 'gnuplot'" in <bound method GnuplotProcess.__del__ of <Gnuplot.gp_win32.GnuplotProcess instance at 0x0127C170>> i Exception AttributeError: "Gnuplot instance has no attribute 'gnuplot'" in <bound method Gnuplot.__del__ of <Gnuplot._Gnuplot.Gnuplot instance at 0x0127C148>> ignored Did some additional reading about python installs, and found that often a *.pth file is required to specify the path to the directory which contains the module, so following the conventions of some other packages I have installed, I created a Gnuplot.pth file in the site-packages directory with a single line as follows (since the paths seem to be relative to the directory the .pth file is in): Gnupath Still no luck. The “import Gnuplot” still fails. Anyone got any ideas? Even if it is next steps for debug, which I suspect needs to be around the area of how python locates modules in files on disk (I am not a Python expert) … Here is the gpxplot.py script, the failing import is in the plot_in_gnuplot function. http://gpxplot.googlecode.com/svn/trunk/gpxplot.py Any help appreciated. … Brian |
From: Wonseok S. <ws...@st...> - 2009-04-29 23:54:39
|
I have figured out how to generate data that can be fed to Gnuplot by myself. It should be an array of [row, col, val]. So, here is what I did: import Gnuplot from numpy import * g = Gnuplot.Gnuplot(persist=True) C = zeros((11,11), 'f') C[5,5] = 1.0 nrow, ncol = C.shape dg = [[i,j,C[i,j]] for i in range(nrow) for j in range(ncol)] # data for gnuplot d = Gnuplot.Data(e, with_='image') g.plot(d) On Apr 29, 2009, at 15:09 , Wonseok Shin wrote: > So I have: > >> from numpy import zeros > >> C = zeros((11,11),'f') > >> C[5,5] = 1.0 > > Then how can I plot this array with "plot ... with image"? > What is the way to convert C into a type of data that can be fed > into the gnuplot command "plot ... with image"? > > - Wonseok > > > On Apr 29, 2009, at 0:37 , Benny Malengier wrote: > >> >> >> 2009/4/29 Wonseok Shin <ws...@st...> >> Hello, >> >> Is there some way to use a gnuplot command "plot ... with image"? >> This is a relatively new feature in gnuplot version 4.2 to draw a 2D >> image, and probably by that reason I cannot easily find a good >> example >> of its usage in gnuplot.py. >> >> Specifically, I want to to draw 2D NumPy array C[i, j] with "plot ... >> with image". >> >> Newer commands are not directly available in gnuplot.py, but you >> can send normal gnuplot commands to do everything gnuplot can handle. >> >> Benny >> > > ------------------------------------------------------------------------------ > Register Now & Save for Velocity, the Web Performance & Operations > Conference from O'Reilly Media. Velocity features a full day of > expert-led, hands-on workshops and two days of sessions from industry > leaders in dedicated Performance & Operations tracks. Use code > vel09scf > and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf_______________________________________________ > Gnuplot-py-users mailing list > Gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-py-users |
From: Wonseok S. <ws...@st...> - 2009-04-29 22:09:24
|
So I have: >> from numpy import zeros >> C = zeros((11,11),'f') >> C[5,5] = 1.0 Then how can I plot this array with "plot ... with image"? What is the way to convert C into a type of data that can be fed into the gnuplot command "plot ... with image"? - Wonseok On Apr 29, 2009, at 0:37 , Benny Malengier wrote: > > > 2009/4/29 Wonseok Shin <ws...@st...> > Hello, > > Is there some way to use a gnuplot command "plot ... with image"? > This is a relatively new feature in gnuplot version 4.2 to draw a 2D > image, and probably by that reason I cannot easily find a good example > of its usage in gnuplot.py. > > Specifically, I want to to draw 2D NumPy array C[i, j] with "plot ... > with image". > > Newer commands are not directly available in gnuplot.py, but you can > send normal gnuplot commands to do everything gnuplot can handle. > > Benny > |
From: Benny M. <ben...@gm...> - 2009-04-29 07:37:41
|
2009/4/29 Wonseok Shin <ws...@st...> > Hello, > > Is there some way to use a gnuplot command "plot ... with image"? > This is a relatively new feature in gnuplot version 4.2 to draw a 2D > image, and probably by that reason I cannot easily find a good example > of its usage in gnuplot.py. > > Specifically, I want to to draw 2D NumPy array C[i, j] with "plot ... > with image". > Newer commands are not directly available in gnuplot.py, but you can send normal gnuplot commands to do everything gnuplot can handle. Benny |
From: Wonseok S. <ws...@st...> - 2009-04-29 06:45:54
|
Hello, Is there some way to use a gnuplot command "plot ... with image"? This is a relatively new feature in gnuplot version 4.2 to draw a 2D image, and probably by that reason I cannot easily find a good example of its usage in gnuplot.py. Specifically, I want to to draw 2D NumPy array C[i, j] with "plot ... with image". - Wonseok Shin |
From: Rémi C. <Rem...@fr...> - 2009-04-13 18:29:26
|
Hi, I am trying to make an animated plot with gnuplot controlled from a python program. The problem is I did not find a command to sync with gnuplot. More precisely my program looks like this: while True: write data to 'file.dat' plot 'file.dat' with gnuplot wait a little the problem is in 'wait a little'. Sometimes, gnuplot is too slow, and does not plot 'file.dat' fast enough. So the file may be destroyed before it is plotted. What I would need is a command that would wait for gnuplot to finish plotting. Is there such a command ? I could not find it. It should be easy to implement. Just send 'echo "sync"' to gnuplot, and wait for a line with "sync" in return. I will probably implement this myself. I found some interesting ideas there: http://www.physik.tu-dresden.de/~baecker/python/gnuplot.html Maintainers of gnuplot-py may wish to implement these functions. It seems very convenient, and easy to implement. Rémi |
From: Edoardo P. <e....@nk...> - 2009-03-31 10:58:24
|
Dear users, I'd like to use gnuplot-py on windowsxp. I have python 2.6. Apparently I managed to take the setup.py install to the end. As a matter of facts import Gnuplot doesn't return errors. Anyway when I try the demo.py I get this: gnuplot> set terminal windows gnuplot> set title "A simple example" gnuplot> set data style linespoints gnuplot> plot "c:\\docume~1\\ef634~1.pas\\locals~1\\temp\\tmpm5ee2g.gnuplot" notitle Please press return to continue... Traceback (most recent call last): File "C:\Program Files\Paive-1.0\Lib\site-packages\Gnuplot\demo.py", line 110, in <module> demo() File "C:\Program Files\Paive-1.0\Lib\site-packages\Gnuplot\demo.py", line 36, in demo g.reset() File "C:\Program Files\Paive-1.0\lib\site-packages\Gnuplot\_Gnuplot.py", line 366, in reset self('reset') File "C:\Program Files\Paive-1.0\lib\site-packages\Gnuplot\_Gnuplot.py", line 210, in __call__ self.gnuplot(s) File "C:\Program Files\Paive-1.0\lib\site-packages\Gnuplot\gp_win32.py", line 130, in __call__ self.write(s + '\n') IOError: [Errno 22] Invalid argument I have tried to check the proper file names in the gp_win32.py and updated to the location of pgnuplot.exe but there was no apparent difference: it always failed. I presume that the error is indicating something different but I cannot figure out what. I gave a look at the mailing list archives before writing this email. Thanks Edoardo -- Edoardo Pasca, Ph.D Nederlands Kanker Instituut -- Antoni van Leeuwenhoek Ziekenhuis Radiotherapy Department Plesmanlaan 121 1066 CX Amsterdam tel: 0031 (0)20 512 1759 |
From: Xaver W. <xav...@we...> - 2009-03-04 15:46:37
|
Hi, basically, I agree, we probably don't need to raise an exception. However, isinstance(m, numpy.ndarray) returns 'True' for any valid numpy array, which includes e. g. string arrays, and for a non-gnuplot compatible array the error message with your code is gnuplot> plot "/tmp/tmpndt27x.gnuplot/fifo" notitle ^ line 0: Bad data on line 1 ..not very helpful. I'd propose to rather have explicitly permitted array types, like if m.dtype.name in ('float64','float32','int32',int64'): return m else: return numpy.array(m,dtype=numpy.float32) whereas the 'else' clause serves mainly for having a defined error message, maybe intercepted by a 'try...except'. This might also eliminate the redundant conversion from float32 to float32 (if python/numpy is not intelligent enough to not do that). What about int32 / int64 arrays? It would be just fine to not convert them as well, right? Saves memory, I guess... Xaver P.S.: Is diff --context oldfile.py oldfile_new.py >> mypatch.py.patch the right way to make a patch file for the tracker? I've never done that before... Am Dienstag, 3. März 2009 14:40:51 schrieb Alan G Isaac: > You are correct: the try clause now succeeds > > because downcasting is allowed: > >>> x = np.random.random((5,)) > >>> x.dtype > > dtype('float64') > > >>> x32 = x.astype(np.float32) > >>> x32.dtype > > dtype('float32') > > How about returning any ndarray untouched? > > if isinstance(m, numpy.ndarray): > return m > else: > return numpy.array(m,dtype=numpy.float32) > > I see no need to print an error message: > NumPy will report appropriately. > > Alan Isaac > > > > --------------------------------------------------------------------------- >--- Open Source Business Conference (OSBC), March 24-25, 2009, San > Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing > the Enterprise -Strategies to boost innovation and cut costs with open > source participation -Receive a $600 discount off the registration fee with > the source code: SFAD http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Gnuplot-py-users mailing list > Gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-py-users |
From: Alan G I. <ai...@am...> - 2009-03-03 13:41:10
|
You are correct: the try clause now succeeds because downcasting is allowed: >>> x = np.random.random((5,)) >>> x.dtype dtype('float64') >>> x32 = x.astype(np.float32) >>> x32.dtype dtype('float32') How about returning any ndarray untouched? if isinstance(m, numpy.ndarray): return m else: return numpy.array(m,dtype=numpy.float32) I see no need to print an error message: NumPy will report appropriately. Alan Isaac |
From: Lois <loi...@gm...> - 2009-03-03 09:39:16
|
I've been trying to make Gnuplot-py to work with MacPython 2.5 (I have VPython installed) and haven't had much success.I'm a new PC convert, I've learnt a few basics things in Terminal, like changing directories. I'll be very grateful if someone guides me through this. These are the files I downloaded (from Sourceforge.net) gnuplot-4.3.0-2008-11-21.tar gnuplot-py-1.8.tar numpy-1.2.1-py2.5-macosx10.5.dmg AquaTerm1.0.1.dmg Thanks, Lois |
From: Benny M. <ben...@gm...> - 2009-03-03 08:12:53
|
I suggest you look up things in numpy doc. If nothing there, use the python way of determining things: if m: if isinstance(m[0], numpy.float64): raise TypeError Provide a patch to gnuplot when you make it work. Benny 2009/3/3 Michael Haggerty <mh...@al...> > Xaver Wurzenberger wrote: > > Hi guys, > > > > I'm sorry to bring this up again, but I'm about to publish my code and > I'd > > really love to get this straight/fixed. In case you don't remember, I'm > > trying to plot high precision numbers (float64, that is), but gnuplot.py > > converts them to float32 arrays. > > Michael Haggerty told me to 'workaround' by using numpy double arrays, > but it > > seems that's not working here. I think the problem might be here: > > (/usr/share/pyshared/Gnuplot/utils.py, line 20ff) > > > >> def float_array(m): > >> """Return the argument as a numpy array of type at least 'Float32'. > >> > >> Leave 'Float64' unchanged, but upcast all other types to > >> 'Float32'. Allow also for the possibility that the argument is a > >> python native type that can be converted to a numpy array using > >> 'numpy.asarray()', but in that case don't worry about > >> downcasting to single-precision float. > >> > >> """ > >> > >> try: > >> # Try Float32 (this will refuse to downcast) > >> return numpy.asarray(m, numpy.float32) > >> except TypeError: > >> # That failure might have been because the input array was > >> # of a wider data type than float32; try to convert to the > >> # largest floating-point type available: > >> # NOTE TBD: I'm not sure float_ is the best data-type for this... > >> try: > >> return numpy.asarray(m, numpy.float_) > >> except TypeError: > >> # TBD: Need better handling of this error! > >> print "Fatal: array dimensions not equal!" > >> return None > > > > If I understand this correctly, the line > >> return numpy.asarray(m, numpy.float32) > > is supposed to raise a TypeError if you give a numpy.float64 array. > > However, my python shell doesn't: > > > >> (00:13:52)xaver@siduxbox:~$python > >> Python 2.5.4 (r254:67916, Feb 18 2009, 03:00:47) > >> [GCC 4.3.3] on linux2 > >> Type "help", "copyright", "credits" or "license" for more information. > >>>>> import numpy > >>>>> a = numpy.array( [2.000000001,3.0,4.0] ) > >>>>> a.dtype > >> dtype('float64') > >>>>> numpy.asarray(a, numpy.float32) > >> array([ 2., 3., 4.], dtype=float32) > > > > Am I doing sth wrong? Can anyone confirm that? > > I don't see that you are doing anything wrong. That array-conversion > code was written long ago, originally for Numeric (not numpy). > Apparently numpy behaves differently than Numeric in this situation, > resulting in a Gnuplot.py bug. > > I suggest that you try to find the right incantation for Gnuplot.py to > do this conversion without losing precision, and submit a patch to > Gnuplot.py. > > Michael > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Gnuplot-py-users mailing list > Gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-py-users > |