Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #2904 > unrolled thread

Plot with boxes and Pipe Questions - May 11, 2015

Started by"E.D.G." <edgrsprj@ix.netcom.com>
First post2015-05-11 06:31 -0500
Last post2015-05-14 07:09 -0700
Articles 5 — 3 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  Plot with boxes and Pipe Questions - May 11, 2015 "E.D.G." <edgrsprj@ix.netcom.com> - 2015-05-11 06:31 -0500
    Re: Plot with boxes and Pipe Questions - May 11, 2015 Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2015-05-14 00:45 +0200
      Re: Plot with boxes and Pipe Questions - May 11, 2015 "E.D.G." <edgrsprj@ix.netcom.com> - 2015-05-15 05:45 -0500
        Re: Plot with boxes and Pipe Questions - May 11, 2015 "E.D.G." <edgrsprj@ix.netcom.com> - 2015-05-15 07:19 -0500
    Re: Plot with boxes and Pipe Questions - May 11, 2015 Gavin Buxton <gavinbuxton@gmail.com> - 2015-05-14 07:09 -0700

#2904 — Plot with boxes and Pipe Questions - May 11, 2015

From"E.D.G." <edgrsprj@ix.netcom.com>
Date2015-05-11 06:31 -0500
SubjectPlot with boxes and Pipe Questions - May 11, 2015
Message-ID<a5GdnZhGFpVgD83InZ2dnUU7-WudnZ2d@earthlink.com>
Posted by E.D.G. May 11, 2015

"Plot With Boxes" and Fortran - Windows - Gnuplot Pipe Questions


PLOT WITH BOXES

       Running in a Windows environment, my Perl language programs are 
storing large amounts of data in files.  Gnuplot is instructed to start 
running (pgnuplot.exe).  And a "Pipe" is being opened between the Perl 
programs and Gnuplot.  Commands are sent to Gnuplot using that Pipe.

       I would like to have Gnuplot display filled boxes using those data. 
And I need to know what the format of the Plot command should be and what 
type of data should be stored in the data files.

---  The boxes need to be two dimensional "filled."  The boarders can be 
either absent or the same color as the fill.

---  I am planning to put X and Y coordinate information for the boxes in 
the data files.

---  I would like to eventually have a box color option for the box fill. 
But for the moment, just filling them with light or dark shades of black 
would be fine.

---  In the data file along with the X and Y coordinates of the boxes I can 
include a darkness number for a given box.  Right now the range is 0 to 100 
with 0 being blank or white and 100 being completely black.  I can convert 
those numbers to any range.  And I could also use a color system such as the 
RGB if necessary.

       So, what would be the command code?  The furthest I myself could get 
without making this a major research project was the following code:

plot "data.dat' with boxes

       Attempts to get the box color and fill part of the command to work 
just right were unsuccessful.


FORTRAN - WINDOWS - GNUPLOT PIPE QUESTIONS

       My Perl language programs running in a Windows environment are 
gradually being converted to Fortran F95 for increased calculation speed. 
And I am trying to determine how to open a Windows environment Fortran F95 
or gfortran "Pipe" to Gnuplot so that Gnuplot can be told when and how to 
create charts.

       Presently, my Perl programs first tell an older version of 
pgnuplot.exe to start running.  Then they use the following Open command to 
create a Pipe to Gnuplot.

open gnuplot, '|pgnuplot.exe';

       Any commands can then be "printed" to the Perl "output file" gnuplot. 
And Gnuplot executes them.

       It took a lot of time and effort to get Perl to work with Gnuplot 
like that.  But it was worth it as the charts that Gnuplot creates can run 
in an interactive mode under the control of my Perl programs.  And when a 
chart looks like it is ready for storage as a file, the Perl programs will 
store it as a .png file that I can send to other researchers and post on my 
Web sites.

       Does anyone know how that open pipe command would work for Fortran 
F95 or gfortran?

       Other Fortran programming personnel are interested in learning how 
Fortran could control Gnuplot like that.  I posted notes to the Fortran 
Newsgroup.  But no one could easily answer that question.  And a retired 
professional programmer that I work with who is doing the Fortran 
conversions was unable to determine how to open a Fortran - Windows - 
Gnuplot type of Pipe.

Regards to all,

E.D.G.

[toc] | [next] | [standalone]


#2907

FromHans-Bernhard Bröker <HBBroeker@t-online.de>
Date2015-05-14 00:45 +0200
Message-ID<cri2gmFl1pkU1@mid.dfncis.de>
In reply to#2904
Am 11.05.2015 um 13:31 schrieb E.D.G.:

>        Running in a Windows environment, my Perl language programs are
> storing large amounts of data in files.  Gnuplot is instructed to start
> running (pgnuplot.exe).

You should probably have converted from pgnuplot.exe to the actual 
console version, gnuplot.exe years ago...

>        Attempts to get the box color and fill part of the command to
> work just right were unsuccessful.

That's not a particularly useful problem description if you don't show 
any hint at what those unsuccessful attempts looked like.  Until then, 
see "help boxes".

>        My Perl language programs running in a Windows environment are
> gradually being converted to Fortran F95 for increased calculation
> speed.

I have serious doubts that is going to work out.  You would almost 
certainly be a good deal better off doing _your_ programming in Perl or 
Python, and just calling some F95 code from there.  Or just do it all in 
an established number-crunching environment (R, MatLab, Octave, NumPy, 
you choose).  Most of those have graphic capabilites of their own, too 
(some using gnuplot as a backend).

>        Does anyone know how that open pipe command would work for
> Fortran F95 or gfortran?

I guess not.  But that's probably because you're asking the wrong 
people.  That is entirely a Fortran issue.  You open a pipe to 
(p)gnuplot exactly the same way as you would open a pipe to any other 
program.  So it's a question of which standard library functions 
(FORTRANers apparently call those "intrinsics") come with your 
implementation of F95, and how portable your programs need to be between 
different platforms.

[toc] | [prev] | [next] | [standalone]


#2909

From"E.D.G." <edgrsprj@ix.netcom.com>
Date2015-05-15 05:45 -0500
Message-ID<VKydneD3PpgSU8jInZ2dnUU7-bGdnZ2d@earthlink.com>
In reply to#2907
"Hans-Bernhard Bröker" <HBBroeker@t-online.de> wrote in message 
news:cri2gmFl1pkU1@mid.dfncis.de...
>
> You should probably have converted from pgnuplot.exe to the actual console 
> version, gnuplot.exe years ago...

       The first reason for not updating gnuplot to a newer version has been 
the fact that the older one does the job perfectly well for my applications.

       The second reason is that gnuplot is included with free download zip 
file versions of my Windows environment computer programs.  And with that 
older version of gnuplot all I had to do was include pgnuplot.exe and 
wgnuplot.exe in the zip file.  Both are relatively small.


>
>>        Attempts to get the box color and fill part of the command to
>> work just right were unsuccessful.
>
> That's not a particularly useful problem description if you don't show any 
> hint at what those unsuccessful attempts looked like.  Until then, see 
> "help boxes".

      I went to the "help with boxes" routine first.  And the plot with 
boxes command itself is simple enough.  But getting the color part of the 
command to work properly takes some time.  I tried quite a few different 
combinations.  None did exactly what I need to have done.  And I was hoping 
that someone might remember exactly what the correct color instructions 
would be.  That doesn't appear to be the case.  So I will just keep trying 
various possibilities until one of them produces the desired result.


>>        My Perl language programs running in a Windows environment are
>> gradually being converted to Fortran F95 for increased calculation
>> speed.
>
> I have serious doubts that is going to work out.  You would almost 
> certainly be a good deal better off doing _your_ programming in Perl or 
> Python, and just calling some F95 code from there.  Or just do it all in 
> an established number-crunching environment (R, MatLab, Octave, NumPy, you 
> choose).  Most of those have graphic capabilites of their own, too (some 
> using gnuplot as a backend).

       The main consideration here is that whatever language is chosen, all 
of the people with whom I am working need to be willing to use it.  And the 
only language that everyone seems to like is Fortran.  I would prefer Perl 
myself.  But that isn't an option.  Some of the conversion work has already 
been done.

       Perl with PDL, Python, Matlab, various versions of Basic including 
Visual Basic, and Julia were all considered.  But one of the features of the 
language of choice is that it has to be a free download program that has a 
compiler that is easy to use.  And Silverfrost F95 with Plato is basically 
the only language that seems to meet that demand.  I could never get the PDL 
Perl module or Julia to work properly.

       Some of the Fortran people would prefer that the gfortran version be 
used.  But as far as I can tell it isn't as easy to use as Silverfrost F95 
with Plato.  Plus, once the Fortran programs are created they are easy to 
convert from one version to another.  Going from Perl to Fortran has been 
"interesting."  But that has not been anywhere near as difficult as shifting 
from GW-BASIC to Perl many years ago.

       People in the Fortran Newsgroup were asked about that "pipe" option. 
No one had an answer.  But there is another blog to check.  And one of my 
programming colleagues should have already done that.  I am mainly a 
scientist and only do programming work when no one else is willing or able 
to do the work.

       There are a number of graphics options with Fortran.  We likely won't 
be using gnuplot as the graphics package.  I wanted to know about the 
Fortran to gnuplot pipe in part because a Fortran specialist wanted the 
information.  So I thought that I would ask in this Newsgroup.

Regards,

E.D.G.

[toc] | [prev] | [next] | [standalone]


#2910

From"E.D.G." <edgrsprj@ix.netcom.com>
Date2015-05-15 07:19 -0500
Message-ID<Pu2dnQlFx-PDecjInZ2dnUU7-aOdnZ2d@earthlink.com>
In reply to#2909
"E.D.G." <edgrsprj@ix.netcom.com> wrote in message 
news:VKydneD3PpgSU8jInZ2dnUU7-bGdnZ2d@earthlink.com...

Posted by E.D.G.   May 15, 2015

>>>        Attempts to get the box color and fill part of the command to
>>> work just right were unsuccessful.

Variations of the following look like they will work:

plot "data.dat" with boxes fs solid lt rgb "#dfdfdf"

[toc] | [prev] | [next] | [standalone]


#2908

FromGavin Buxton <gavinbuxton@gmail.com>
Date2015-05-14 07:09 -0700
Message-ID<8e5c7c41-a06b-4752-b7cb-31ac20a197f8@googlegroups.com>
In reply to#2904
Sorry, I use C but its pretty simple.... use popen instead fopen and then send commands like I was sending to a file. I don't know fortran though, and I imagine working in windows would make this harder? Good luck!

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web