RCH has asked for the wisdom of the Perl Monks concerning the following question:
Dear PerlMonks
What must I do to get Chart::Gnuplot to plot two different Y variables vs X on one chart?
My two Y variables are:-
Y1 NFrogs, with values between zero and 400.
Y2 AirTemperature, with values between -10 and 25.
Variable X Time runs from 1 February to 28 April, with one value per day for NFrogs, 1 value every 20 minutes for Temperature.
So I set yrange => [0,400], # Numbers of frogs crossing the road each evening
And y2range => [-5,20], # Air temperatures by http://api.wunderground.com
Then with
$chart->plot2d( $Frogs, $Temperatures)
I get a graph of two variables, NFrogs and Temperatures, vs Date. But both NFrogs and Temperatures are plotted on a scale of 0 to 400.
The other way round i.e.
$chart->plot2d($Temperatures, $Frogs)
this time, NFrogs and Temperatures are both plotted on a scale of -10 to 25.
How do I get each Y variable plotted on its own scale?
http://www.gnuplot.info/faq
says
(Q.) 4.7 Does gnuplot support multiple y-axes on a single plot?
(A.) Yes. You can have 2 x- and 2 y-axes per plot. The additional axes are called x2 and y2.
But I cant find an example of this at CPAN's Gnuplot Examples
RichardH
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Chart::Gnuplot Frogs and Temperatures vs date
by VinsWorldcom (Prior) on Oct 15, 2014 at 14:44 UTC | |
|
Re: Chart::Gnuplot Frogs and Temperatures vs date
by VinsWorldcom (Prior) on Oct 16, 2014 at 00:59 UTC | |
|
Re: Chart::Gnuplot Frogs and Temperatures vs date
by RCH (Sexton) on Oct 16, 2014 at 07:38 UTC |