On 27.02.2015 22:33, Allin Cottrell wrote:
On Fri, 27 Feb 2015, Artur T. wrote:
> I've got another question regarding gnuplot. At the moment gretl
> automatically draws a 2nd yaxis (if it is not suppressed by the
> "--single-yaxis" option) if a certain criteria is fulfilled. However,
> is there a way to specify manually a separate variable (or a list of
> vars) to a 2nd yaxis?
Not within gretl's "gnuplot" command; you'd have to take charge of
that yourself.
I am just writing the function for this but I've got a problem with the
quotation marks.
This:
printf "set timefmt \"%Y%m\" \n"
results in
<output>
*** error in function plot_ts_y2axis, line 42
printf "set timefmt \"%Y%m\" \n"
</output>
I couldn't find a solution to this, unfortunately. Could anybody give me
a hint, please?
Reverting to the time data business for a moment: what actually
happens here is that if you specify "set xdata time" gnuplot rewrites
the x-axis values as seconds since some reference point -- in current
gnuplot that's the unix "epoch" which begins at the start of 1970. So
a preset x range based on your x numbers in the 200-thousands would
translate to a few hours or days in January 1970. No wonder no data
were shown!
We now (CVS) try to be a little smarter: we check if the "literal"
argument to gnuplot contains "set xdata time", and if so we don't
attempt to set the x range.
We print an x-range setting in gretl-generated gnuplot scripts only
because sometimes this seems to come out quite sub-optimally in
gnuplot itself. The x range can be "too tight" in that you get data
points that are right on the y-axis and therefore hard to see. We try
to ensure that there's a little elbow room around the minimum and
maximum x-values in the data.
Yes, this is a good idea. And it works here fine.
Allin
_______________________________________________
Artur