it is also possible to do this automatically, in a 2-step process:
reset
# dummy plot to set yrange automatically
set term push
set out
set term dumb
plot 50.*(sin(x)+1.)
set term pop
c2f(x)=((x*9.)/5.)+32.
set yrange [GPVAL_Y_MIN:GPVAL_Y_MAX]
set y2range [c2f(GPVAL_Y_MIN):c2f(GPVAL_Y_MAX)]
set ytics nomirror
set ylabel "Temperature [Celsius]"
set y2tics
set y2label "Temperature [Fahrenheit]"
replot
Thomas Sefzick wrote:
>
> set yrange [0:100]
> set y2range [0:1]
>
>
> mw-u2 wrote:
>>
>> Hi,
>>
>> how can I get y2tics and labels when y1 and y2 are related, eg.
>> y2=0.2*y1?
>>
>> Imagine y1 0%-100% and y2 0-1, or a y1 being in meters/s and y2 being in
>> km/h.
>>
>> I tried:
>>
>> set ytics nomirror
>> set y2tics
>> plot "foo.dat", "" u 1:(0.2*$2) axes x1y2 notitle
>>
>> but I think plotting the same thing twice is overkill.
>>
>> Thank you for your consideration,
>> Micha
>>
>> Please CC me since I am not on the list.
>> --
>> Sarah Kreuz, die DSDS-Siegerin der Herzen, mit ihrem eindrucksvollen
>> Debütalbum "One Moment in Time". http://portal.gmx.net/de/go/musik
>>
>> --
>> Sarah Kreuz, die DSDS-Siegerin der Herzen, mit ihrem eindrucksvollen
>> Debütalbum "One Moment in Time". http://portal.gmx.net/de/go/musik
>>
>> ------------------------------------------------------------------------------
>> Join us December 9, 2009 for the Red Hat Virtual Experience,
>> a free event focused on virtualization and cloud computing.
>> Attend in-depth sessions from your desk. Your couch. Anywhere.
>> http://p.sf.net/sfu/redhat-sfdev2dev
>> _______________________________________________
>> Gnuplot-info mailing list
>> Gnu...@li...
>> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>>
>>
>
>
--
View this message in context: http://old.nabble.com/y2axis-tp26624073p26628507.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|