between tic years?

between tic years?

Post by Vic Norto » Thu, 01 Sep 2005 03:41:44


There has got to be an easy way.

I want to plot data that looks like this

...
2000.9563 2.26 1.36
2000.9754 2.08 1.49
2000.9945 2.20 1.61
2001.0137 2.22 1.53
2001.0329 2.22 1.59
2001.0521 2.16 1.51
2001.0712 2.17 1.41
...

The first column shows the x variable in years. The other columns
contain y values.

I want the y-axis to be labelled in the usual way, with the values
..., 0, 1, 2, 3, ...,
to the left of the y-tics, but I would like the years
..., 1999, 2000, 2001, 2002, ...
to lie BETWEEN the x-tics. Is there any easy way to do this? The
years normally appear underneath the x-tics.
 
 
 

between tic years?

Post by Juergen Wi » Thu, 01 Sep 2005 15:56:20


[Get year label into the middle of the year!]

Hmm, as of Gnuplot 4.0, I only know two kludges: Firstly, you can
explicitly set the tics using "set xtics (...)", secondly, you can
use a format string with lots of spaces before the year:

set format " %Y".

Gnuplot 4.1 has an explicit "offset" option to "set xtics".


Juergen

 
 
 

between tic years?

Post by Theo Hopma » Fri, 02 Sep 2005 03:15:02


To paraphrase: you want invisible tic marks associated with the
labelled tics, but unlabelled visible tic marks. The following will do
this, even in 4.0:

set xtics 1
set mxtics 2
set ticscale 0 1 # zero size major tics, minor tics sized like major
default
plot 'data'

THeo
 
 
 

between tic years?

Post by Juergen Wi » Fri, 02 Sep 2005 15:44:48


Good point. But one has to remember to shift the x-data half a year
to the left:

plot 'data' using ($1-0.5):2


Juergen