[Thread Prev][Thread Next][Index]

Re: [ferret_users] 2nd Y-scale/lablel color?



Hi,
Hein almost has it.  The vertical limits from the example in the FAQ are as he says not what we want on the plot.  For that example, we can leave those arguments to ppl %yaxis blank and let Ferret/PPLUS fill in the right numbers,
ppl pen,0,1
ppl axset,1,1,1,0
plot /x=-100:100 sin(x/10)
plot /over/col=6 /x=-100:100 cos(x/10)
ppl pen,0,6
ppl %yaxis ,,,100,1,2,1,+1
The first 3 values there are the low, high, and delta-y, so you could do this, for instance,
ppl pen,0,1
ppl axset,1,1,1,0
plot /x=-100:100 sin(x/10)
plot /over/col=6 /x=-100:100 cos(x/10)
ppl pen,0,6
ppl %yaxis -1,1,0.05,100,1,2,1,+1

However if the second line plot has an entirely different scale, the plot/over won't draw the second line on the plot.  What I'd use is the two-viewport trick.  Define two identical viewports and make two plots, each in its own viewport.
yes? define view/x=0:1/y=0:1 vfull1
yes? define view/x=0:1/y=0:1 vfull2

yes? set view vfull1
yes? plot/axes=1,1,1,0/x=-100:100/title=" "/set sin(x/10)
yes? ppl ylab sin(x/10)
yes? ppl plot

yes? set view vfull2
yes? ppl pen,0,6
yes? plot/axes=0,0,0,1/x=-100:100/color=6/title=" "  30-cos(x/10)
yes? ppl ylab 30-cos(x/10)
yes? ppl plot


You'd probably want to CANCEL MODE LOGO first...


On 12/3/2013 12:24 AM, Hein Zelle wrote:
Dear Luke,

I'm trying to make an XY plot with 2 y-axis. I was wondering... is there a
way I can change the color for the label & scale of one of the y-axis I am
plotting? In my case, I am trying to make the Y-axis scale & label for the
variable "lux" have a red color.
The label and axis colors are controled by pen 0.  If you
change that one, you'll see the effect.

 ppl pen 0,6
 plot /x=-100:100 sin(x/100)

That makes them all purple.  It becomes easy if you combine this with 

http://ferret.pmel.noaa.gov/Ferret/faq/how-can-i-draw-a-second-vertical-axis-on-a-contour-plot

ppl pen,0,1
ppl axset,1,1,1,0
plot /x=-100:100 sin(x/10)
plot /over/col=6 /x=-100:100 cos(x/10)
ppl pen,0,6
ppl %yaxis 0,60,5,100,1,2,1,+1

I get confused when trying to put the second plot command after ppl
%yaxis command: ferret uses the new yaxis but it seems to use the old
vlimits.  Someone else can probably explain how to do that.

Kind regards,
	
	Hein



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement