[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pass arguments to functions without ()
From: |
Dirk Eddelbuettel |
Subject: |
Re: pass arguments to functions without () |
Date: |
Thu, 4 Jun 1998 20:45:24 -0400 (EDT) |
Daniel> 2) How can I talk to gnuplot. I know gset, gplot, replot. Can I
Daniel> pipe all the over commands as well? e.g. "save" and whatever?
Piping is a good solution if you want to pass things to gnuplot which the
Octave parser doesn't swallow. For report-creating cronjobs, I wrote a couple
of .m files containing variations of the following:
fid = popen("gnuplot", "w");
if (postscript)
printf("Creating a postscript graph in '%s'\n", graphfile);
fputs(fid, "set terminal postscript\n");
fputs(fid, sprintf("set output \"%s\"\n", graphfile));
endif
fputs(fid, "set timefmt \"%Y%m%d\"\n");
fputs(fid, "set xdata time\n");
fputs(fid, "set format x \"%m/%y\"\n");
fputs(fid, "set data style lines\n");
fputs(fid, "set nokey\n");
...
pclose(fid);
If you use gnuplot pre3.6, you can even pass the data via the pipe and can
skip writing data to a tmpfile. See help on 'datafile' under the help for
'plot' within gnuplot.
--
mailto:address@hidden According to the latest official figures,
http://rosebud.ml.org/~edd 43% of all statistics are totally worthless.