On Wed, 20 May 2015, shahar siegman wrote:
Hi,
I'm fairly new to gretl. It's a good tool that helps me with my work.
I have a question about plotting time series (daily data) with the date as
labels on the x axis.
I've noticed that when using the --time-seires option in gnuplot, the plot
is always against a single data scale (on the left).
In other words, the option --time-series, seems to imply --single-yaxis.
This behavior is not documented in the User's Guide and I want to ask if
there is a way to undo this behavior and let a gnuplot with --time-series
use both left and right axes. If I don't use --time-series, I can still
plot versus an index column but then the x-labels are not dates.
Here's an example to illustrate:
open anscombe.gdt
setobs 7 2015-02-18 --time-series # assign some arbitrary date range to
sample data
genr index
y100=y1*100 # scale the data by 100 to get different value ranges
gnuplot x y100 --time-series --with-lp # both series on left axis scale
gnuplot x y100 index --with-lp # second series scale is separate (Right
axis)
I see what you mean. It's not supposed to be that way, something must
have slipped. We'll get that fixed.
Another note, I had an idea that a potential workaround could be
adding a
unix-timestamp column to my data (I can easily do that with my data source)
and then telling gnuplot to format the x axis as a date. Something like:
gnuplot y1 y2 unix_day --with-lines {gnuplot commands;}
where unix_day is the unix-timestamp column.
Can anyone with gnuplot experience tell me what commands need to go in the
braces for this to work?
I think you'd want:
set xdata time ; set format x "%Y-%m-%d" ;
where the format is up to you.
Allin Cottrell