|
From: mattyd <mat...@ho...> - 2013-03-18 13:17:10
|
I have tried this code and it works great. But I am having trouble getting this approach to work with time-series data. I have replaced the first column of the test.dat file with dates: test.dat (revised) ************* 2001-1-1 2 1 2001-1-2 2 4 2001-1-3 1 9 2001-1-4 2 16 2001-1-5 1 25 2001-1-6 2 36 ************* when I run the following lines: set xdata time set timefmt '%Y-%m-%d' lastx = NaN ; lasty = NaN ; selection = 2 plot 'test.dat' using ($2==selection?($1,lastx=$1):lastx):($2==selection?($1,lasty=$3):lasty) with linespoints I get the following message: Warning: empty x range [2001:2001], adjusting to [1980.99:2021.01] and it looks like all of the x values are read as 2001. When I do a test plot without conditions (i.e., plot 'test.dat' using 1:3 with linespoints) it looks fine, so it seems that the problem lies with the approach of using the previous point, but I can't figure out what it is. Can anyone please help? -- View this message in context: http://gnuplot.10905.n7.nabble.com/Conditional-plot-with-lines-tp3519p17196.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |