My initial 2 thoughts:
1) I definitely like this better than the curly braces, but
2) How would this work with the plot ... end plot environment? Could that idea be
generalized to "boxplot", etc.? So either something like
<hansl>
boxplot
[various options, literals, etc.]
end boxplot
</hansl>
Or alternatively
<hansl>
plot
type=boxplot (freq, etc.) # I'd prefer something like this -- one environment instead
of several
[various options, literals, etc.]
end plot
</hansl>
Or do you see the --tweaks option taking the place of the plot environment?
PS
-----Original Message-----
From: gretl-users-bounces(a)lists.wfu.edu [mailto:gretl-users-
bounces(a)lists.wfu.edu] On Behalf Of Allin Cottrell
Sent: Wednesday, March 23, 2016 4:53 PM
To: Gretl users
Subject: [Gretl-users] new plot --tweaks option
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
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users