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-03-03 05:34:19
|
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 |
From: Xaver W. <xav...@we...> - 2009-03-02 23:20:24
|
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? Thanks in advance, Xaver |
From: Michael H. <mh...@al...> - 2009-03-01 08:33:51
|
Matt Ball wrote: > What is the easiest way to create a scatterplot using gnuplot.py? I > simply need to plot sets of data points as (x,y) pairs, but can't find > any reasonable documentation on this. I know I can plot a 1D Python > array by passing that array to a plot() command (in Python, of > course), but I can't do the same if I pass in a 2D array, e.g. where > array[*][0] is the x-coordinate and array[*][1] is the y-coordinate. > Surely there must be a dead-simple way to do this that I'm missing! demo.py has some examples. Michael |
From: Matt B. <ba...@br...> - 2009-03-01 08:21:00
|
What is the easiest way to create a scatterplot using gnuplot.py? I simply need to plot sets of data points as (x,y) pairs, but can't find any reasonable documentation on this. I know I can plot a 1D Python array by passing that array to a plot() command (in Python, of course), but I can't do the same if I pass in a 2D array, e.g. where array[*][0] is the x-coordinate and array[*][1] is the y-coordinate. Surely there must be a dead-simple way to do this that I'm missing! Thanks, Matt |
From: Michael H. <mh...@al...> - 2009-02-06 06:08:08
|
[Please don't send Gnuplot.py emails to me personally. I am sending a CC of this response to the correct mailing list.] Roland deWit wrote: > When I run the attached script Function1.py in Python I get a plot. > However, when I run Function2.py I don't get a plot. Would you know how > to fix that? > > [Function1.py:] > import Gnuplot > > g = Gnuplot.Gnuplot(debug=1) > f = Gnuplot.Func('2*x**2') > g.plot(f) > > > [Function2.py:] > import Gnuplot > > g = Gnuplot.Gnuplot(debug=1) > a = 2 > f = Gnuplot.Func('a*x**2') > g.plot(f) That is because the argument to Func() is passed to gnuplot for evaluation, and gnuplot knows nothing about the Python variable called "a". There are two obvious ways to make this work: g("a = 2") # Assign the *gnuplot* variable "a" f = Gnuplot.Func('a*x**2') or # Interpolate "a" into the function string *before* passing it # to gnuplot: f = Gnuplot.Func('%s*x**2' % (a,)) Michael |
From: Alan G I. <ai...@am...> - 2009-01-31 19:21:58
|
On 1/31/2009 2:05 PM Matt Ball apparently wrote: > Is it possible to pass Gnuplot.py some form of a Python lambda > expression? I'm looking to plot a variety of functions of 1 variable, > which I have lambda expressions for. All I need is basic 2D plotting > functionality beyond that. A lambda expression creates a function instance. You can pass it like any function. E.g., http://gnuplot-py.sourceforge.net/doc/Gnuplot/funcutils.html Alan Isaac |
From: Matt B. <ba...@br...> - 2009-01-31 19:05:46
|
Is it possible to pass Gnuplot.py some form of a Python lambda expression? I'm looking to plot a variety of functions of 1 variable, which I have lambda expressions for. All I need is basic 2D plotting functionality beyond that. Matt |
From: Michael H. <mh...@al...> - 2009-01-26 06:13:39
|
[I re-added the mailing list to CC.] Matt Ball wrote: > On Jan 24, 2009, at 11:53 PM, Michael Haggerty wrote: >> Matt Ball wrote: >>> [...] However, if I run my python script (which uses >>> gnuplot.py) through x11, I run into two problems: if my gnuplot >>> constructor does not have the persist=1 option, then the plot window >>> disappears as soon as it appears. >> >> Normally, it should only disappear when the Gnuplot instance is >> destroyed by your script (for example, if your script ends). If you >> keep the Gnuplot instance alive then the window should continue to be >> displayed. >> >>> However, when I do use the >>> constructor (e.g. as g = Gnuplot.Gnuplot(persist=1)) then the plot >>> window does persist but it's not interactive! >>> I don't think that I am asking a lot to have an interactive and >>> persistent gnuplot window. How can I do this on my Mac? I am perfectly >>> happy to use something other than AQT or X11 if it gets the job done. >> >> This is more of a gnuplot question than a Gnuplot.py question. > > Thanks, Michael. It just seemed like a Gnuplot.py issue because I can > rotate my plots just fine if I use gnuplot's interactive mode, but not > if I call it though a python script. I haven't had time to play around > with using a normal gnuplot script. I don't know the situation on your platform, but if I start "gnuplot -persist" under Linux with the default terminal type (which is wxt), then I can interact with the graphics window even after the gnuplot command line has been exited. But if I switch to x11, then I can interact with the graphics window as long as the command line is active, but when I exit the command line, then I can't interact with the window anymore. So either use a different terminal type, or keep the gnuplot process running as long as you want to interact with the window. Michael |
From: Michael H. <mh...@al...> - 2009-01-25 04:53:20
|
Matt Ball wrote: > [...] However, if I run my python script (which uses > gnuplot.py) through x11, I run into two problems: if my gnuplot > constructor does not have the persist=1 option, then the plot window > disappears as soon as it appears. Normally, it should only disappear when the Gnuplot instance is destroyed by your script (for example, if your script ends). If you keep the Gnuplot instance alive then the window should continue to be displayed. > However, when I do use the > constructor (e.g. as g = Gnuplot.Gnuplot(persist=1)) then the plot > window does persist but it's not interactive! > I don't think that I am asking a lot to have an interactive and > persistent gnuplot window. How can I do this on my Mac? I am perfectly > happy to use something other than AQT or X11 if it gets the job done. This is more of a gnuplot question than a Gnuplot.py question. Michael |
From: Matt B. <ba...@br...> - 2009-01-25 00:17:40
|
Hi, I am trying to use Gnuplot.py as part of a Python script which I am developing on a Mac running Leopard (the latest version). It works exactly as expected when I use Aquaterm as my terminal, though plotting matrices 100x100 or larger can get very slow. I am trying to move away from AQT since it is old and does not support interactive viewing, e.g. rotation or zooming. I can start gnuplot itself from X11, set the terminal to be x11, and then make pretty plots that are fully interactive. However, if I run my python script (which uses gnuplot.py) through x11, I run into two problems: if my gnuplot constructor does not have the persist=1 option, then the plot window disappears as soon as it appears. However, when I do use the constructor (e.g. as g = Gnuplot.Gnuplot(persist=1)) then the plot window does persist but it's not interactive! I don't think that I am asking a lot to have an interactive and persistent gnuplot window. How can I do this on my Mac? I am perfectly happy to use something other than AQT or X11 if it gets the job done. Thanks! Matt |
From: Ivar R. <ref...@gm...> - 2009-01-20 21:22:59
|
Hi, I'm getting this error after typing from scitools.all import * scitools.easyviz backend is gnuplot Exception exceptions.AttributeError: "GnuplotProcess instance has no attribute 'gnuplot'" in <bound method GnuplotProcess.__del__ of <Gnuplot.gp_win32.GnuplotProcess instance at 0x00F0C698>> ignored Exception exceptions.AttributeError: "Gnuplot instance has no attribute 'gnuplot'" in <bound method Gnuplot.__del__ of <Gnuplot._Gnuplot.Gnuplot instance at 0x00F0C648>> ignored There is no backtrack, so I don't know where this is happening. It could be the fault of scitools. I configured gp_win32.py like this: # gnuplot_command = r'"C:\Program Files\gp371w32\pgnuplot.exe"' #gnuplot_command = r'pgnuplot.exe' gnuplot_command = r'C:\python25\gnuplot\bin\pgnuplot.exe' # this file exists of course. I did a dir(self.gnuplot) in gp_win32.py and this variable does exist and its methods seems correct. Including pgnuplot.exe in the PATH variable didn't help. pgnuplot.exe is launched (I can see it running in the task bar..) Any suggestions? Thank you very much, Best regards, Ivar Refsdal |
From: Xaver W. <xav...@we...> - 2009-01-11 23:33:13
|
Hi, thanks for the quick answers, I was thinking that it might be some float-precision problem. But, being a newbie and as gnuplot.py apparently doesn't have a documentation, I couldn't figure it out. You're right, this type of precision is probably only interesting for physicists and us chemists ;-) And I could probably do with less precision, I just haven't bothered to think about if rounding is always a good idea. But couldn't there be an auto-detection for the float type or sth? I mean, if someone's passing highly precise numbers, he'll probably want to plot them correctly... Could you maybe point me to some information on how to use that workaround? I've tried reading the list values as 'np.float64' or converting the list via 'np.asarray(x).astype(np.float64)' but that doesn't seem to change anything... Regards, X.W. Am Sunday 11 January 2009 17:47:07 schrieb Alan G Isaac: > On 1/11/2009 11:34 AM Michael Haggerty apparently wrote: > > Not Python arrays, but numpy arrays. The reason this is done is to save > > space for huge data sets. My assumption was that it is unusual to plot > > values that vary only in the ninth decimal place. And since there is a > > workaround, it doesn't seem like a bad compromise. > > How about letting dtype be an optional argument? > The default can be np.float32, but the user could > specify any dtype. > > Alan Isaac > > > --------------------------------------------------------------------------- >--- Check out the new SourceForge.net Marketplace. > It is the best place to buy or sell services for > just about anything Open Source. > http://p.sf.net/sfu/Xq1LFB > _______________________________________________ > Gnuplot-py-users mailing list > Gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-py-users -- Xaver Wurzenberger Guardinistr. 89 81375 München Tel.: 089/32163661 Mobil: 0179/4478756 |
From: Alan G I. <ai...@am...> - 2009-01-11 16:47:19
|
On 1/11/2009 11:34 AM Michael Haggerty apparently wrote: > Not Python arrays, but numpy arrays. The reason this is done is to save > space for huge data sets. My assumption was that it is unusual to plot > values that vary only in the ninth decimal place. And since there is a > workaround, it doesn't seem like a bad compromise. How about letting dtype be an optional argument? The default can be np.float32, but the user could specify any dtype. Alan Isaac |
From: Michael H. <mh...@al...> - 2009-01-11 16:34:54
|
Alan G Isaac wrote: > On 1/11/2009 9:53 AM Michael Haggerty apparently wrote: >> The Gnuplot.py library uses float (i.e., single-precision) arrays to >> store values internally. When your value is rounded to >> single-precision, it results in the number that is actually plotted. > > Are you saying it uses the Python array > module to do this? This seems a very > odd decision. Why not just change that > to 'double'? Not Python arrays, but numpy arrays. The reason this is done is to save space for huge data sets. My assumption was that it is unusual to plot values that vary only in the ninth decimal place. And since there is a workaround, it doesn't seem like a bad compromise. But feel free to change it in your copy :-) Michael |
From: Alan G I. <ai...@am...> - 2009-01-11 15:27:28
|
On 1/11/2009 9:53 AM Michael Haggerty apparently wrote: > The Gnuplot.py library uses float (i.e., single-precision) arrays to > store values internally. When your value is rounded to > single-precision, it results in the number that is actually plotted. Are you saying it uses the Python array module to do this? This seems a very odd decision. Why not just change that to 'double'? Alan Isaac |
From: Michael H. <mh...@al...> - 2009-01-11 14:54:06
|
Xaver Wurzenberger wrote: > I am trying to plot large negative numbers, with 9 digits after the ., via > python (version 2.5.2-3) and python-gnuplot, version 1.8-1 (both Debian Sid > packages), on terminal 'dumb', so ascii output. > But it occurs to me that whenever I plot them from a (float or string) python > list (g.plot(Gnuplot.Data(list)), gnuplot is plotting a wrong number. > [...] > > list_scf[0][1] is -902.904164954 The Gnuplot.py library uses float (i.e., single-precision) arrays to store values internally. When your value is rounded to single-precision, it results in the number that is actually plotted. IIRC you can get around this by passing a numpy double array to the plot() method; I think that the library leaves the values as double precision in this case. Michael |
From: Xaver W. <xav...@we...> - 2009-01-11 12:30:44
|
Hi, I'm a newbie to python programming, so I hope this is not a dumb mistake of mine ;-) I am trying to plot large negative numbers, with 9 digits after the ., via python (version 2.5.2-3) and python-gnuplot, version 1.8-1 (both Debian Sid packages), on terminal 'dumb', so ascii output. But it occurs to me that whenever I plot them from a (float or string) python list (g.plot(Gnuplot.Data(list)), gnuplot is plotting a wrong number. Plotting a file (g.plot(Gnuplot.File('file.plt')) however works. Look at this example: I "zoomed in" to the first value here (the ascii formatting is lost due to the email, but I think you can see the problem; look at the asterisk psoition and y axis numbers!): (12:55:03)xaver@siduxbox:~/Programme/python$./gw-minimal2.py test_real.log 39 cycles and -902.904164954 Hartree written to list of energies. 5 cycles and -902.912462667 Hartree written to list of energies. 6 cycles and -902.921650947 Hartree written to list of energies. 6 cycles and -902.927426487 Hartree written to list of energies. 6 cycles and -902.930537069 Hartree written to list of energies. 6 cycles and -902.933026922 Hartree written to list of energies. 21 cycles and -902.935555041 Hartree written to list of energies. 6 cycles and -902.937610935 Hartree written to list of energies. 6 cycles and -902.939101838 Hartree written to list of energies. 6 cycles and -902.94003734 Hartree written to list of energies. 6 cycles and -902.94119645 Hartree written to list of energies. 6 cycles and -902.942518852 Hartree written to list of energies. 15 cycles and -902.944932326 Hartree written to list of energies. 6 cycles and -902.947591728 Hartree written to list of energies. 6 cycles and -902.949241052 Hartree written to list of energies. 6 cycles and -902.950658896 Hartree written to list of energies. 6 cycles and -902.951400948 Hartree written to list of energies. 6 cycles and -902.952198923 Hartree written to list of energies. list_scf is [[39, -902.90416495399995], [44, -902.912462667], [50, -902.92165094699999], [56, -902.92742648700005], [62, -902.93053706900002], [68, -902.93302692199995], [89, -902.93555504100004], [95, -902.93761093499995], [101, -902.93910183800006], [107, -902.94003734], [113, -902.94119645000001], [119, -902.94251885200003], [134, -902.94493232599996], [140, -902.94759172800002], [146, -902.94924105200005], [152, -902.95065889600005], [158, -902.95140094800001], [164, -902.95219892299997]] list_scf[0][1] is -902.904164954 Plotting float values: Energy/Hartree -902.904174810 ++-----+-------+------+-------+------+------+-------+-----++ + + + + + SCF Optimization +.*..+ + | : | | : | -902.904174808 ++ : ++ | : | | : | -902.904174806 ++ : ++ | : | | * | | | -902.904174804 ++ ++ | | | | -902.904174802 ++ ++ | | | | + + + + + + + + + -902.904174800 ++-----+-------+------+-------+------+------+-------+-----++ 20 40 60 80 100 120 140 160 180 Cycles Plotting plt file: Energy/Hartree -902.904164960 ++-----+-------+------+-------+------+------+-------+-----++ + + + "test_real.log.plt" using 1:2 +.*..+ + | : | | : | -902.904164958 ++ : ++ | : | | : | -902.904164956 ++ : ++ | : | | : | | : | -902.904164954 ++ * ++ | | | | -902.904164952 ++ ++ | | | | + + + + + + + + + -902.904164950 ++-----+-------+------+-------+------+------+-------+-----++ 20 40 60 80 100 120 140 160 180 Does anyone know what's wrong here? I can put all files on the net somewhere, if that helps. Thanks in advance, X. W. |
From: Michael H. <mh...@al...> - 2009-01-04 04:30:11
|
nit...@gm... wrote: > For some project of mine I'd like to use dates in Gnuplot.Data and be > able to use x2 and y2 axes (plot keyword axis). > > Is there any chance these get implemeted soon? You can, of course, pass arbitrary commands to gnuplot via the Gnuplot object, so in principle you can do what you want from your own code. But (particularly for the case of x2/y2) this won't be very convenient. Gnuplot.py doesn't currently have any active developers, and there haven't been any new features implemented in quite a while. So you shouldn't have high hopes that your wishes will be implemented soon. If you want to work on them yourself, I'd be happy to help get you started. Or consider offering a bounty to somebody to develop it. Michael |
From: <nit...@gm...> - 2009-01-03 13:59:41
|
Hi there, For some project of mine I'd like to use dates in Gnuplot.Data and be able to use x2 and y2 axes (plot keyword axis). Is there any chance these get implemeted soon? Thanks in advance, Kai |
From: А. Т <se...@gm...> - 2008-12-30 19:19:04
|
Hi! I have the following code: from numpy import * import Gnuplot, Gnuplot.funcutils from time import sleep def main(): g = Gnuplot.Gnuplot(debug=1) g.title('A simple example') # (optional) g('set output "out2.svg"') #g('set term svg size 200, 100'); g('set style data linespoints') # give gnuplot an arbitrary command g.plot([[0,1.1], [1,5.8], [2,3.3], [3,4.2]]) #sleep(1) if __name__ == '__main__': main() It produces a zero size file 'out2.svg' unless i uncomment sleep(1) I've played a bit with gp_win32.py and i'm sure that return code is 0 for pgnuplot.exe. Hey! When i wrote the lines above, I realized that it is a mistake in pgnuplot.exe! It exits before wgnuplot.exe does. So i've changed its behavior and it works. Hope this helps Windows users. thanks |
From: Michael H. <mh...@al...> - 2008-10-08 14:00:23
|
Cuneyt Ertal wrote: > Hi I am new in programming in python. I create a data file with python. > It's layout like this: > > x y1 y2 y3 > y4 y5 > --------- --------- -------- ----------- > ------- ------------ > 1e-06 3.5344 22.09 61.7796 121.0 199.9396 > 1e-05 3.5344 22.09 61.7796 121.0 199.9396 > 0.0001 3.5344 22.09 61.7796 121.0 199.9396 > 0.001 3.5344 22.09 61.7796 121.0 199.9396 > 0.01 3.5344 22.09 61.7796 121.0 199.9396 > 0.1 3.5344 22.09 61.7796 121.0 199.9396 > 1 3.5344 22.09 61.7796 121.0 199.9396 > 10 3.5344 22.09 61.7796 121.0 199.9396 > 100 3.4596 21.8089 61.3089 120.5604 199.6569 > 1000 2.4649 19.0969 57.4564 116.8561 197.1216 > 10000 5.5225 39.8161 104.2441 189.3376 294.4656 > 100000 5.0625 34.9281 98.8036 185.5044 292.7521 > > I want to plot x-y1, x-y2, x-y3, x-y4, x-y5 curves. But I could not > assign values in x column of data file to variable x by using gnuplot. I > can do this simply > > data=load('somedatafile.dat') > x=data[:,0] > > with pylab package. Is there a similar load method in gnuplot.py ? No, but you could presumably use the one from pylab, or it would be trivial to write your own. Then stick the results into a Plotitems.Data instance to plot it. Michael |
From: Benny M. <ben...@gm...> - 2008-10-08 13:31:59
|
Read the test.py and demo.py files in the gnuplot.py package. So: benny@pccage69:/tmp$ python Python 2.5.2 (r252:60911, Jul 31 2008, 17:31:22) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import Gnuplot >>> thefile1 = Gnuplot.File('test', using = (1,2)) >>> thefile2 = Gnuplot.File('test', using = (1,3)) >>> g.plot(thefile1,thefile2) gnuplot> plot "test" using 1:2, "test" using 1:3 >>> g('set log x') gnuplot> set log x >>> g.plot(thefile1,thefile2) gnuplot> plot "test" using 1:2, "test" using 1:3 Which gives the required graph if you now make thefile3, .... Alternatively you can read the file in once, and make arrays of every column, then plot the arrays. Benny 2008/10/8 Cuneyt Ertal <cun...@gm...> > Hi I am new in programming in python. I create a data file with python. > It's layout like this: > > x y1 y2 y3 > y4 y5 > --------- --------- -------- ----------- ------- > ------------ > 1e-06 3.5344 22.09 61.7796 121.0 199.9396 > 1e-05 3.5344 22.09 61.7796 121.0 199.9396 > 0.0001 3.5344 22.09 61.7796 121.0 199.9396 > 0.001 3.5344 22.09 61.7796 121.0 199.9396 > 0.01 3.5344 22.09 61.7796 121.0 199.9396 > 0.1 3.5344 22.09 61.7796 121.0 199.9396 > 1 3.5344 22.09 61.7796 121.0 199.9396 > 10 3.5344 22.09 61.7796 121.0 199.9396 > 100 3.4596 21.8089 61.3089 120.5604 199.6569 > 1000 2.4649 19.0969 57.4564 116.8561 197.1216 > 10000 5.5225 39.8161 104.2441 189.3376 294.4656 > 100000 5.0625 34.9281 98.8036 185.5044 292.7521 > > I want to plot x-y1, x-y2, x-y3, x-y4, x-y5 curves. But I could not assign > values in x column of data file to variable x by using gnuplot. I can do > this simply > > data=load('somedatafile.dat') > x=data[:,0] > > with pylab package. Is there a similar load method in gnuplot.py ? > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Gnuplot-py-users mailing list > Gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-py-users > > |
From: Cuneyt E. <cun...@gm...> - 2008-10-08 13:08:27
|
Hi I am new in programming in python. I create a data file with python. It's layout like this: x y1 y2 y3 y4 y5 --------- --------- -------- ----------- ------- ------------ 1e-06 3.5344 22.09 61.7796 121.0 199.9396 1e-05 3.5344 22.09 61.7796 121.0 199.9396 0.0001 3.5344 22.09 61.7796 121.0 199.9396 0.001 3.5344 22.09 61.7796 121.0 199.9396 0.01 3.5344 22.09 61.7796 121.0 199.9396 0.1 3.5344 22.09 61.7796 121.0 199.9396 1 3.5344 22.09 61.7796 121.0 199.9396 10 3.5344 22.09 61.7796 121.0 199.9396 100 3.4596 21.8089 61.3089 120.5604 199.6569 1000 2.4649 19.0969 57.4564 116.8561 197.1216 10000 5.5225 39.8161 104.2441 189.3376 294.4656 100000 5.0625 34.9281 98.8036 185.5044 292.7521 I want to plot x-y1, x-y2, x-y3, x-y4, x-y5 curves. But I could not assign values in x column of data file to variable x by using gnuplot. I can do this simply data=load('somedatafile.dat') x=data[:,0] with pylab package. Is there a similar load method in gnuplot.py ? |
From: Benny M. <ben...@gm...> - 2008-09-24 17:55:29
|
Ok, but if you can do it in gnuplot, you can pass your own commands directly via the pipe, see http://gnuplot-py.sourceforge.net/doc/Gnuplot/__init__.html So in gnuplot it works to do: gnuplot> plot x*x lc rgbcolor "blue" Hence, in python we can do: python Python 2.5.2 (r252:60911, Jul 31 2008, 17:31:22) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import Gnuplot >>> g1 = Gnuplot.Gnuplot() >>> g1('plot x*x lc rgbcolor "blue"') >>> g1('replot x lc rgbcolor "red"') >>> As you can make the above dynamic in your python script, you can do all. As for index, I don't understand what you want to achieve, g1 above holds the plot Hope this helps Benny 2008/9/24 Eric S. Johansson <es...@ha...> > Benny Malengier wrote: > > Look in the gnuplot manual. You can do gnuplot commands with gnuplot-py. > > Also have a look in the test file in subversion. > > I took a look at the test file and it had nothing about color is that I > could > see. Yes, some of the method calls had color for an argument but it made > no > sense. Reading from the canoe plot manual, I tried to use the line style > but, > that also failed. I also couldn't see how to associate a particular index > with > a plot. > > gnuplot> plot '/tmp/tmpVLMckL' notitle > gnuplot> plot '/tmp/tmpKwgJDc' notitle, '/tmp/tmpUPRlPx' notitle > gnuplot> set title "Plot of generation score_002000" > gnuplot> set object 1 rect from -5,0 to 5,500 fc rgb "#3366ff" > gnuplot> set xrange[-100:100] > gnuplot> set yrange[0:100] > gnuplot> set autoscale fix > gnuplot> set terminal gif > gnuplot> set style line 0 lc rbgcolor red > gnuplot> set style line 1 lc rbgcolor blue > gnuplot> set output "plot/image_score_002000.gif" > gnuplot> plot '/tmp/tmpYGhnBq' notitle > gnuplot> plot '/tmp/tmpcSr0gh' notitle, '/tmp/tmpL1XY2s' notitle > > gnuplot> set style line 0 lc rbgcolor red > ^ > line 0: tag must be > zero > > line 0: undefined variable: rbgcolor > > > > > > Benny > > > > 2008/9/22 Eric S. Johansson <es...@ha... <mailto:es...@ha...>> > > > > I'm trying to put before and after plots on the same image and I > > need each plot > > to be in a different color. How do I specify the color change in > > the plot method? > > > > thanks > > > > ---eric > > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's > > challenge > > Build the coolest Linux based applications with Moblin SDK & win > > great prizes > > Grand prize is a trip for two to an Open Source event anywhere in > > the world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > <http://moblin-contest.org/redirect.php?banner_id=100&url=/> > > _______________________________________________ > > Gnuplot-py-users mailing list > > Gnu...@li... > > <mailto:Gnu...@li...> > > https://lists.sourceforge.net/lists/listinfo/gnuplot-py-users > > > > > |
From: Eric S. J. <es...@ha...> - 2008-09-24 16:23:21
|
Benny Malengier wrote: > Look in the gnuplot manual. You can do gnuplot commands with gnuplot-py. > Also have a look in the test file in subversion. I took a look at the test file and it had nothing about color is that I could see. Yes, some of the method calls had color for an argument but it made no sense. Reading from the canoe plot manual, I tried to use the line style but, that also failed. I also couldn't see how to associate a particular index with a plot. gnuplot> plot '/tmp/tmpVLMckL' notitle gnuplot> plot '/tmp/tmpKwgJDc' notitle, '/tmp/tmpUPRlPx' notitle gnuplot> set title "Plot of generation score_002000" gnuplot> set object 1 rect from -5,0 to 5,500 fc rgb "#3366ff" gnuplot> set xrange[-100:100] gnuplot> set yrange[0:100] gnuplot> set autoscale fix gnuplot> set terminal gif gnuplot> set style line 0 lc rbgcolor red gnuplot> set style line 1 lc rbgcolor blue gnuplot> set output "plot/image_score_002000.gif" gnuplot> plot '/tmp/tmpYGhnBq' notitle gnuplot> plot '/tmp/tmpcSr0gh' notitle, '/tmp/tmpL1XY2s' notitle gnuplot> set style line 0 lc rbgcolor red ^ line 0: tag must be > zero line 0: undefined variable: rbgcolor > > Benny > > 2008/9/22 Eric S. Johansson <es...@ha... <mailto:es...@ha...>> > > I'm trying to put before and after plots on the same image and I > need each plot > to be in a different color. How do I specify the color change in > the plot method? > > thanks > > ---eric > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > <http://moblin-contest.org/redirect.php?banner_id=100&url=/> > _______________________________________________ > Gnuplot-py-users mailing list > Gnu...@li... > <mailto:Gnu...@li...> > https://lists.sourceforge.net/lists/listinfo/gnuplot-py-users > > |