This is a follow-up to the discussion started by Frederik Schaff at
http://lists.wfu.edu/pipermail/gretl-users/2016-March/011701.html
Frederik was asking, among other things, if we could generalize the
mechanism available for the "gnuplot" command, whereby you can add
extra gnuplot commands within a special string enclosed by "{" and
"}" -- for example, to customize frequency plots.
While I can see the case for this, I was a bit reluctant on the
grounds that the "{ ... }" mechanism is very much an ad hoc thing
and kind of an "unruly" element within hansl syntax.
I think I now have a better alternative, more consistent with modern
hansl syntax and capabilities. It's not yet documented, because I
want to leave space for discussion and possible improvements, but
here's the current status:
The commands "gnuplot", "boxplot", "scatters" and
"freq" now have an
option --tweaks which requires as argument the name of an array of
strings. The strings in the array are inserted into the gnuplot
command file after the intial "boilerplate" lines but before the
"plot" command. Here's an illustration:
<hansl>
open data4-10
strings S = array(2)
S[1] = "set title 'My Preferred Title'"
S[2] = "set label 'Delaware' at 0.18,0.25"
gnuplot ENROLL CATHOL --tweaks=S --output=display
S[2] = "set yrange [0:0.5]"
freq ENROLL --silent --tweaks=S --plot=display
list X = CATHOL INCOME COLLEGE WHITE
S[1] = "set border 3"
S[2] = ""
scatters ENROLL ; X --tweaks=S --output=display
</hansl>
If we reckon this is worthwhile it could be generalized to all
commands that generate plots without too much difficulty. Note that
there's no need for the somewhat "fussy" syntax of wrapping in
braces and terminating gnuplot commands with semicolons.
Allin