On Sat, 1 Oct 2016, Sven Schreiber wrote:
I've done some experiments to get (vertical) lines indicating
pointwise
confidence intervals into a plot with gnuplot. Basically I have one question
and one feature request.
First the question: it concerns some gnuplot code which works in pure gnuplot
but not as a saved graph symbol in gretl's session view. Here's a concrete
example: Start by running the following hansl snippet in gretl:
<hansl>
nulldata 10
setobs 1 1990 --time-series
series y = 2 * normal()
series width = uniform()
test <- plot y
options time-series with-lines
options band=y,width band-style=fill,0x000000
end plot --output=display
</hansl>
Now in the produced plotting code (right-click the graph symbol and choose
"edit plot commands") there's the following line:
<gnuplot>
'-' using 1:($2-1*$3):($2+1*$3) notitle lc rgb "#000000" w filledcurve,
\
</gnuplot>
If I copy the entire code into a new text file and load that in gnuplot it
works alright.
Then I change (two things in) the line above to obtain (notice the extra
"($2)"!):
<gnuplot>
'-' using 1:($2):($2-1*$3):($2+1*$3) notitle lc rgb "#000000" w
errorbars, \
</gnuplot>
... and loading the modified file in gnuplot produces what I want (attached).
However, if I apply these exact modifications to the plotting commands saved
in the session view icon of the graph and try to view the result, I get an
"unspecified error". So the question is simply, why doesn't it work there?
Are you sure about the "exact" in that statement? When I edit the
plot file as you specify it works both in stand-alone gnuplot and in
gnuplot as called from gretl (e.g. by clicking the "gears" icon in
the plot editor window, or, after saving the revised plot, by
double-clicking on the plot's icon. I know of no reason why it would
fail in the second case if it works in the first.
The associated feature request is to enable an errorbars option to
the
band-plotting apparatus. Basically adding a new band-style option "errorbars"
which writes the gnuplot code that I have described above.
Yes, that would be a good thing to add.
Allin