info-gnuplot-digest V1 #2068

info-gnuplot-digest V1 #2068

Post by gavin buxt » Fri, 06 Jun 2003 01:47:25



Hi,

Yep, you have to open a link to gnuplot

File *fp;

fp = popen("gnuplot","w");

then somebody posted recently that you can plot data
stored in x[] and y[] arrays (up to index N-1) like so

         fprint(fp, "plot \"-\"\n");
         for (i=0; i<N; i++)
                fprintf(fp, "%f %f\n", x[i], y[i]);
         fprintf(fp, "e\n");

Although I usually dump to a file and then just plot
using

        fprintf(fp, "plot 'file.dat' u 1:2\n")

were file.dat is were I usually dump data for example.

when your done, just close gnuplot by using
pclose(fp);

Does that answer your question?

Gavin.

Quote:> This is my problem - I have program in c that gives
> me output of 4 data files, some of them in 4
> columns... I want to plot data directly
> (interactively) after calling the executable file
> produced from the source c file - is there a
> possibillity to somehow implement calling gnuplot
> form c??? eg, if I have to call - plot "df1", "df2"
> using 1:2, "df2" using 3:4 from gnuplot, how would I
> do the call from c and get the same result?

> if this is not possible, could you recommand some
> program that would do this easily - I tried sm,
> pgplot and plplot and have failed miserably, please
> help me if you can...

> Thank you

> Kosta Popovic
> Hamilton College

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
 - -
[[[[ to unsubscribe from info-gnuplot, send an email with body
unsubscribe info-gnuplot

]]]]
 
 
 

1. info-gnuplot-digest V1 #2094

Hi,

You can control the size of the plotting using xrange
and yrange, which gives you the limits, or bounds, of
your plot. And if you want them to look the same then
you can use set xtics to put the tics where you want,
and also whatever you want. For example....

set xrange[0:10]
set yrange[0:10]
set xtics ("low" 0, "medium" 5, "high" 10)

Set size only changes the size of the graph relative
to the paper, for example if you want to try and make
it look square or something. Hope this helps.....

Gavin.

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
 - -
[[[[ to unsubscribe from info-gnuplot, send an email with body
unsubscribe info-gnuplot

]]]]

2. How to create.........

3. info-gnuplot-digest V1 #2070

4. corel Move ideas

5. info-gnuplot-digest V1 #2064

6. "Painterly Effects" plug-in???

7. info-gnuplot-digest V1 #2062

8. info-gnuplot-digest V1 #2056

9. info-gnuplot-digest V1 #2028

10. info-gnuplot-digest V1 #2022

11. info-gnuplot-digest V1 #2014

12. info-gnuplot-digest V1 #2007