Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #2051

How can I use two different ranges for y axis?

Newsgroups comp.graphics.apps.gnuplot
Date 2013-09-26 05:45 -0700
Message-ID <f4eef6d6-94d2-42f4-806f-87e575d32b2b@googlegroups.com> (permalink)
Subject How can I use two different ranges for y axis?
From "Dr. David Kirkby" <drkirkby@gmail.com>

Show all headers | View raw


I have some data in a file:

http://www.vnacalibration.co.uk/Kits/SN0014/attenuator.s2p

The first column is the frequency in MHz. I want to plot the 4th column (magnitude) and 5th column (phase) column vs frequency. I can do this in two individual graphs, and get the following. 

http://www.vnacalibration.co.uk/Kits/SN0014/attenuator-magnitude.pdf
http://www.vnacalibration.co.uk/Kits/SN0014/attenuator-phase.pdf


I'd like to plot the two sets of data on one graph, but obviously need different scales for the two y-axes, as one remains close to -30 dB, whereas the other varies from -180 to +180 degrees. 

I tried the following: 

set xlabel "Frequency (MHz)"
set ylabel "Magnitude of S21 (dB)" 
set y2label "Phase of S21 (deg)" 
set yrange [-31:-29]
set y2range [-180:180]
plot "attenuator.s2p" using 1:4 with lines lt rgb "orange" title "magnitude", "attenuator.s2p" using 1:5 with lines lt rgb "blue" title "phase" 

but it seems both graphs are plotted over the range -31 to -29, which is ok for the magnitude data, but not for the phase, which needs to go over the range -180 to +180 degrees. 

I'm using gnuplot 4.6 patchlevel 1. 

Can anyone suggest how I can achieve what I want? 

Dave 

Back to comp.graphics.apps.gnuplot | Previous | NextNext in thread | Find similar | Unroll thread


Thread

How can I use two different ranges for y axis? "Dr. David Kirkby" <drkirkby@gmail.com> - 2013-09-26 05:45 -0700
  Re: How can I use two different ranges for y axis? Karl <mail.kfr@gmx.net> - 2013-09-26 16:47 +0200
    Re: How can I use two different ranges for y axis? Karl <ratzsch@polymer.uka.de> - 2013-09-28 12:59 +0200
      Re: How can I use two different ranges for y axis? "Dr. David Kirkby" <drkirkby@gmail.com> - 2013-10-09 16:28 -0700

csiph-web