🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.graphics.apps.gnuplot
5 messages
5 total messages Started by paulo.peres@pers Fri, 02 Aug 1996 00:00
(no subject)
#3784
Author: paulo.peres@pers
Date: Fri, 02 Aug 1996 00:00
4 lines
41 bytes
unsubcribe peres@csr-lpf.ibama.gov.br


Question: how to run gnuplot from a c program
#3963
Author: ELESUDIP@ukcc.uk
Date: Fri, 16 Aug 1996 00:00
10 lines
219 bytes
Hi
Could anyone tell me how to run gnuplot from my c program.
I am using gnuplot in X11 environment. I am trying to send
commands to the gnuplot from my c program. Please help.
Thanks
Sudip Das
elesudip@ukcc.uky.edu


Re: Question: how to run gnuplot from a c program
#3965
Author: Paul Vradelis
Date: Sat, 17 Aug 1996 00:00
44 lines
1061 bytes
Hi ELESUDIP,


> Could anyone tell me how to run gnuplot from my c program.
> I am using gnuplot in X11 environment. I am trying to send
> commands to the gnuplot from my c program. Please help.
> Thanks
> Sudip Das
> elesudip@ukcc.uky.edu


Try using a pipe:

#define BUFSIZ 256  /* enough space to hold any gnuplot command */
FILE *gp;

int gp_open (void)
{
    gp = popen("gnuplot","w");
    setvbuf(gp, NULL, _IOLBF, BUFSIZ);  /* switch pipe to
                                           line buffered mode */
    return (gp?0:-1);                   /* return -1 if no pipe */
}

int gp_close (void)
{
    return (pclose (gp));               /* returns exit status */
}                                       /* of gnuplot          */

int gnu_plot (const char *command)
{
    if (!gp) return (-1);

    fprintf (gp,command);
    return (0);
}

/* Now you can use gp_open() to create a pipe to gnuplot, gnu_plot()
   to send your commands to gnuplot and gp_close() to terminate
   gnuplot
*/


Re: Question: how to run gnuplot from a c program
#3970
Author: hoffmann@ehmgs2.
Date: Mon, 19 Aug 1996 00:00
31 lines
1016 bytes
In article <177E5BD7CS86.ELESUDIP@ukcc.uky.edu> ELESUDIP@ukcc.uky.edu writes:

   Could anyone tell me how to run gnuplot from my c program.
   I am using gnuplot in X11 environment. I am trying to send
   commands to the gnuplot from my c program. Please help.

There are several possibilities. I simply piped the gnuplot commands:

FILE *gnupip;
gnupip=popen("gnuplot","w");
fprintf(gnupip, "se da st li\n");
fflush(gnupip);

...(here go the real plotting commands as fprintf-fflush combos)

pclose(gnupip);

I did this under HP-UX (X11) and OS/2 (PM), hope it helps.

Thomas.
-- 
=============================================================================
Thomas Hoffmann, Institut fuer Halbleiter- und Mikrosystemtechnik, TU Dresden 
E-mail: hoffmann@ehms1.et.tu-dresden.de

Rich Cook: "Programming today is a race between software engineers striving to
      build bigger and better idiot-proof programs, and the Universe trying to
      produce bigger and better idiots. So far, the Universe is winning."


Re: Question: how to run gnuplot from a c program
#4005
Author: DEVPC@
Date: Fri, 23 Aug 1996 00:00
45 lines
1620 bytes
In <u8ohk7969r.fsf@ehmgs2.et.tu-dresden.de>, hoffmann@ehmgs2.et.tu-dresden.de (Thomas Hoffmann) writes:
>In article <177E5BD7CS86.ELESUDIP@ukcc.uky.edu> ELESUDIP@ukcc.uky.edu writes:
>
>   Could anyone tell me how to run gnuplot from my c program.
>   I am using gnuplot in X11 environment. I am trying to send
>   commands to the gnuplot from my c program. Please help.
>
>There are several possibilities. I simply piped the gnuplot commands:
>
>FILE *gnupip;
>gnupip=popen("gnuplot","w");
>fprintf(gnupip, "se da st li\n");
>fflush(gnupip);
>
>....(here go the real plotting commands as fprintf-fflush combos)
>
>pclose(gnupip);
>
>I did this under HP-UX (X11) and OS/2 (PM), hope it helps.
>
>Thomas.
>-- 
>=============================================================================
>Thomas Hoffmann, Institut fuer Halbleiter- und Mikrosystemtechnik, TU Dresden 
>E-mail: hoffmann@ehms1.et.tu-dresden.de
>
>Rich Cook: "Programming today is a race between software engineers striving to
>      build bigger and better idiot-proof programs, and the Universe trying to
>      produce bigger and better idiots. So far, the Universe is winning."

I was looking at the named pipe option for interfaceing to gnuplot, however,
their is no popen command within the Warp toolkit for working with named pipes.
You have to know the handle of the name pipe inorder to connect to it, Right!
Is their a way or is their a named pipe that is available to talk to gnuplot (3.6)?

BTW
I'm using VisualAge C++ version 3.0 compiler in Warp/Merlin.

   Thanks for any posts or email schipper@edlmail.jsc.nasa.gov

					John Schipper



Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads