Answering my own question (see below):
You can bind a key that will align the x2range to the xrange simply by
typing this (or putting it in your .gnuplotrc):
bind "=" "set x2range [GPVAL_X_MIN:GPVAL_X_MAX] ; replot"
Now, each time you hit the "=" key the x2range is adapted to the xrange (you
need to redo this after each zoom).
The zoom facility of the x11 window acts on the xrange and yrange
coordinates and the x2range and y2range coordinates 'follow', but not
necessarily one-to-one. Like this the "=" key will force the one-to-one
correspondance.
Lambert
lambert wrote:
>
> Hi,
>
> I've read through the mailing list and I'm wondering how to have the two
> axes x and x2 aligned, although the are not meant to be, standard.
>
> i'm using gnuplot 4.2 now.
>
> I have two sets of data: (time,data_value) and (time,some_tag)
>
> The idea is to put the time label on the bottom and the corresponding
> 'some_tags' on the top (x2) axis.
> Using the standard gnuplot settings my 'some_tag' of 04h00 shows up at
> 05h14 (for instance).
>
> The 'autoscale fix' option or the 'set xrange ; set x2range' option won't
> do when you use the zooming features of the x11 terminal.
>
> The only option I see sofar is to manipulate/extrapolate both data sets to
> have mutual extends, but when zooming, this will fail again.
>
> Can someone give a comment/tip on this subject? I would guess an
> 'alignment' feature in a future gnuplot would be of common use to many.
>
> thanks,
> Lambert
>
--
View this message in context: http://www.nabble.com/labelling-dates-on-x-and-corresponding-numbers-on-x2-axis-tf4468321.html#a12776624
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|