www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Low feature GNUPlot controller for D2

reply "SiegeLord" <none none.com> writes:
I have been using a GNUPlot controller for my scientific work 
with D for some time now, so I just wanted to announce that such 
a thing exists if anybody is interested in using it or whatnot. 
It supports very some basic features (hence being low feature) 
which you can view in the example file: 
https://github.com/SiegeLord/DGnuplot/blob/master/example.d

One unique feature that comes for free by virtue of using an 
external plotting program is that you don't have to plot things 
right away, but instead save the commands to a file and plot them 
at a different time (by piping them to gnuplot). I use this 
technique combined with sshfs to plot things remotely.

Anyway, the repository for it is here: 
https://github.com/SiegeLord/DGnuplot
It requires TangoD2 to build and gnuplot 4.4.3 to run (unless 
you're saving commands to a file as described above).
It works on Linux, and maybe on Windows (untested).

-SiegeLord
Mar 11 2012
next sibling parent "SiegeLord" <none none.com> writes:
On Sunday, 11 March 2012 at 21:45:02 UTC, SiegeLord wrote:
 I have been using a GNUPlot controller for my scientific work 
 with D for some time now, so I just wanted to announce that 
 such a thing exists if anybody is interested in using it or 
 whatnot. It supports very some basic features (hence being low 
 feature) which you can view in the example file: 
 https://github.com/SiegeLord/DGnuplot/blob/master/example.d

 One unique feature that comes for free by virtue of using an 
 external plotting program is that you don't have to plot things 
 right away, but instead save the commands to a file and plot 
 them at a different time (by piping them to gnuplot). I use 
 this technique combined with sshfs to plot things remotely.

 Anyway, the repository for it is here: 
 https://github.com/SiegeLord/DGnuplot
 It requires TangoD2 to build and gnuplot 4.4.3 to run (unless 
 you're saving commands to a file as described above).
 It works on Linux, and maybe on Windows (untested).

 -SiegeLord

Forgot to mention, in case people miss it, documentation is also available: http://siegelord.github.com/DGnuplot/doc/gnuplot.html -SiegeLord
Mar 11 2012
prev sibling next sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 3/11/2012 2:45 PM, SiegeLord wrote:
 Anyway, the repository for it is here: https://github.com/SiegeLord/DGnuplot
 It requires TangoD2 to build and gnuplot 4.4.3 to run (unless you're saving
 commands to a file as described above).
 It works on Linux, and maybe on Windows (untested).

Great! Are any parts of it suitable for inclusion in https://github.com/D-Programming-Deimos ?
Mar 11 2012
prev sibling next sibling parent "SiegeLord" <none none.com> writes:
On Monday, 12 March 2012 at 01:02:06 UTC, Walter Bright wrote:

 Are any parts of it suitable for inclusion in 
 https://github.com/D-Programming-Deimos ?

Doubt it, as it literally simply opens up a gnuplot process and pipes commands into it. There is no such thing as a libgnuplot or anything. -SiegeLord
Mar 11 2012
prev sibling next sibling parent "Jay Norwood" <jayn prismnet.com> writes:
On Sunday, 11 March 2012 at 21:45:02 UTC, SiegeLord wrote:
  > Anyway, the repository for it is here:
 https://github.com/SiegeLord/DGnuplot
 It requires TangoD2 to build and gnuplot 4.4.3 to run (unless 
 you're saving commands to a file as described above).
 It works on Linux, and maybe on Windows (untested).

 -SiegeLord

I just tried this on Win7 64 bit using the latest TangoD2 and the gnuplot from this link http://sourceforge.net/projects/gnuplot/files/ I had to substitute pgnuplot.exe, which is one of the windows gnuplot exe versions that accepts the piped input GNUPlot = new Process(true, "pgnuplot.exe -persist"); With that change one of the graphs displayed, the one with title "Raw gnuplot commands". The rest all failed, maybe due to the binary record input, which they try to echo to their text command shell. Maybe if there were an option to use text format input, or maybe there is some terminator expected. Their command shell fails to return to the prompt after echoing the binary data, and doesn't create the graph shell on these others that use the binary record input.
Mar 14 2012
prev sibling next sibling parent "Jay Norwood" <jayn prismnet.com> writes:
On Wednesday, 14 March 2012 at 07:16:39 UTC, Jay Norwood wrote:
  >
 I just tried this on Win7 64 bit using the latest TangoD2 and 
 the gnuplot from this link
 http://sourceforge.net/projects/gnuplot/files/

 I had to substitute pgnuplot.exe, which is one of the windows 
 gnuplot exe versions that accepts the piped input
 GNUPlot = new Process(true, "pgnuplot.exe -persist");

 With that change one of the graphs displayed, the one with 
 title "Raw gnuplot commands".  The rest all failed, maybe due 
 to the binary record input, which they try to echo to their 
 text command shell.

 Maybe if there were an option to use text format input, or 
 maybe there is some terminator expected.  Their command shell 
 fails to return to the prompt after echoing the binary data, 
 and doesn't create the graph shell on these others that use the 
 binary record input.

There was discussion of windows problems with the binary data input elsewhere, including some discussion of the input being opened in text mode. Looks like the cygwin version might be a solution. http://octave.1599824.n4.nabble.com/Gnuplot-scripts-as-output-td1680624.html http://sourceforge.net/tracker/?func=detail&atid=102055&aid=2981027&group_id=2055
Mar 14 2012
prev sibling next sibling parent "Jay Norwood" <jayn prismnet.com> writes:
On Wednesday, 14 March 2012 at 07:33:52 UTC, Jay Norwood wrote:
 On Wednesday, 14 March 2012 at 07:16:39 UTC, Jay Norwood wrote:
  >
 I just tried this on Win7 64 bit using the latest TangoD2 and 
 the gnuplot from this link
 http://sourceforge.net/projects/gnuplot/files/

 I had to substitute pgnuplot.exe, which is one of the windows 
 gnuplot exe versions that accepts the piped input
 GNUPlot = new Process(true, "pgnuplot.exe -persist");

 With that change one of the graphs displayed, the one with 
 title "Raw gnuplot commands".  The rest all failed, maybe due 
 to the binary record input, which they try to echo to their 
 text command shell.


The use of pgnuplot.exe wasn't necessary. The problem turns out to be that it needed "endian=little" in the format string in C2DPlot Plot(...) for my box. After that, all the plots ran perfectly well using the original "gnuplot -persist" string for the process.
Mar 15 2012
prev sibling parent "SiegeLord" <none none.com> writes:
On Thursday, 15 March 2012 at 07:23:38 UTC, Jay Norwood wrote:
 The use of pgnuplot.exe wasn't necessary.  The problem turns 
 out to be that it needed "endian=little" in the format string  
 in C2DPlot Plot(...) for my box.  After that, all the plots ran 
 perfectly well using the original "gnuplot -persist" string for 
 the process.

Thanks for figuring it out and testing! -SiegeLord
Mar 15 2012