On Fri, 10 Oct 2014, Giuseppe Vittucci wrote:
According to me, the best way is:
- leave the "gnuplot" command as it is know to the simpler stuffs;
- create a foreign block to fully use the potential of gnuplot (by the
way, if something is there it does not mean that you can explain it to
your colleagues...).
OK: at this point, I think it's fair to say that a consensus seems to be
forming around the idea of supplementing the "gnuplot" command with a
dedicated environment (which could also mean simplifying the gnuplot
command by removing some of its options, but not necessarily).
Instead, I do not like too much the idea of the plot environment
cause
it seems half in between the full control given by the foreign block and
the clean and simple control for ready-to-use plots given by the gnuplot
command.
Well, I kind of changed my mind on this. We still have a large user base
who would like to adjust graphs by using the GUI widget, which I use quite
often myself. It's absolutely impossible to have this possibility with
graphs generated by arbitrary gnuplot syntax. So, you have to accept a few
constraints; but, given this, why not work directly with a sublanguage
that is closer to hansl and easier to grasp than gnuplot (and, BTW, could
use other backends if needed, like Sven said)?
And besides, like I said in my previous message: if you really want to use
gnuplot to its full potential, create a tempfile, have gnuplot read it and
produce output. A simple proof-of-concept follows:
<hansl>
function string cool_gnuplot_pic(scalar angle, scalar resolution)
string fname = sprintf("(a)dotdir/%d.gp", floor(randgen1(u,1000,9999)))
outfile @fname --write
printf "set border 4095 front linetype -1 linewidth 1.000\n"
printf "set view %d, 10, 1, 1\n", angle
printf "set samples %d, %d\n", resolution, resolution
printf "set isosamples %d, %d\n", resolution, resolution
printf "unset surface\n"
printf "set title \"Cool, no?\" \n"
printf "set pm3d implicit at s\n"
printf "set pm3d scansbackward\n"
printf "splot sin(sqrt(x**2+y**2))/sqrt(x**2+y**2)\n"
outfile --close
return fname
end function
pic_1 = cool_gnuplot_pic(125, 200)
pic_2 = cool_gnuplot_pic(100, 400)
gnuplot --input=@pic_1 --output=display
gnuplot --input=@pic_2 --output=display
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------