[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuplot-info-beta
Subject:    Re: gnuplot v3.7
From:       "Dick Crawford" <crawford () arete ! com>
Date:       2000-01-24 16:56:24
[Download RAW message or body]

On Wednesday, January 19, 2000: Javier Gozalvez
<j.gozalvez@comms.eee.strath.ac.uk>
wrote:


>hi,
>could you please send me an example of how do you plot on the same graph 2
curves with different y axes, please. I really don't find how to do it in
the new version of
>gnuplot.
>thanks
>javier


[This question probably should have been sent to the general "info-gnuplot"
list instead of "info-gnuplot-beta", which is for discussion of
developmental stuff.  But it's not a mortal sin . . .]

All the commands that refer to a specific axis have a "twin" command (as of
gnuplot 3.7) that refers to the opposite axis.  Thus there are commands such
as "set xlabel" for the bottom axis and "set x2label" for the top, "set
ytics" and "set y2tics" and so forth.  This is also true for axis options --
you can "set logscale x" and "set logscale x2".

When you want to choose which axes to use when plotting, you use the "axes"
option on the "plot" command.  For this option the bottom and left axes are
called "x1" and "y1".  The option comes after "using" and before "title".
Try the following:
    set ylabel "sine"
    set y2label "cosine"
    set yrange [-2:6]
    set y2range [-6:2]
    set ytics nomirror (-1,0,1)
    set y2tics (-1,0,1)
    plot sin(x) title "sine", cos(x) axes x1y2 title "cosine"
[Xtics and ytics are automatically mirrored on the opposite axis -- thus the
"nomirror" option on "set ytics".  If you want to mirror the y2tics on the y
axis (as might be the case if you are not using the y axis), use "set y2tics
mirror".]

Is this enough to get you started?

Dick Crawford, aka crawford@arete.com


[[[[ unsubscribe from info-gnuplot-beta via majordomo@dartmouth.edu ]]]]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic