\cancel mode verify ! right_yaxis_plot.jnl ! Description: Overlay a plot of one variable using an axis on the right ! Overlay a second variable on a plot placing the vertical axis on the right ! The routine left_axis_plot should be used before this. ! *acm* 6/19/2000 fix bug in aline call as suggested by M.Verschell ! usage: ! yes? GO right_yaxis_plot expression_to_plot [scale] [key] [hgt] [args] [ppen] ! 1 exprn - FERRET expression to be plotted ! 2 optional: scale - "low,high,delta" in quotes for axis scaling ! 3 optional: key - title string documenting the variable to be plotted ! 4 optional: hgt - PLOT+ character height for key string [default 0.12] ! 5 optional: "args" specifies all other %yaxis options [",,,,,(1PG10.3)"] ! (see PLOT+ Users' Guide, chapter 10) ! 6 optional: arguments, e.g. line type "thick=2" ! 7 optional: caxis - tuple for axis color [default "100 0 0" = red] ! note: caxis resets pen 1, so any color information in argument 6 ! might be overwritten, use "line=" instead, see example below ! 8 optional: y-offset for right axis label ! example 1: temp and salt on same plot ! yes? set data levitus_climatology ! yes? set region/k=1/l=1/y=0/x=150E:110W ! yes? plot/set temp ! yes? ppl axset 1,1,1,0 ! yes? ppl plot ! yes? GO my_right_axis_plot salt ! --> red line + red axis overlay ! example 2: play with colors ! yes? GO my_right_axis_plot salt " " " " " " " " line=5 "100 0 0" ! --> light blue line + red axis overlay ! example 3: play with significant digits along the y axes ! yes? plot/set temp ! yes? ppl yfor (F3.0) ! yes? ppl axset 1,1,1,0 ! yes? ppl plot ! yes? GO my_right_axis_plot salt " " " " " " ",,,+1,,(F5.2)" ! --> no digits at T-axis, 1 at S-axis ! ! ! initialize (FERRET initializes PLOT+ through "plot/set") define symbol cpen = $6"x" plot/($cpen)/set $1 ppl title ppl labs ppl set axov_midpoint 'ppl$ylen' / 2.0 !ppl set axov_ylabpos 'axov_midpoint' - 3.5 ppl set axov_ylabpos 'axov_midpoint' + `$8` ppl set axov_xlabpos 'ppl$xlen' + 0.9 !ppl set axov_xlabpos 'ppl$xlen' + 0.7 ppl set axov_aline_start 'axov_midpoint' - 2.2 ppl set axov_aline_end 'axov_midpoint' - 0.7 ppl set axov_aline_xpos 'ppl$xlen' + 0.7 define symbol caxis = $7"0 0 0" ppl color 1 ($caxis) ! use this labelling scheme to get good black and white hard copy ppl ylab ppl labs/nouser 1,'axov_xlabpos','axov_ylabpos',+1 $3"@AS'labtit'" ppl hlabs 1,$4"0.12" ppl rlabs 1,-90 ! lay on the new axis ppl %range 'PPL$YMIN1','PPL$YMAX1',10 ppl %yaxis/nouser $2"'ppl$range_low','ppl$range_high','ppl$range_inc'",'ppl$xlen',$5",,,+1,,(1F5.1)" ! draw the plot ppl window off ppl plot/over ! set up the line specimen !ppl aline/nouser 1,'axov_aline_xpos','axov_aline_start','axov_aline_xpos','axov_aline_end' ! clean up ppl window on ppl axset 1,1,1,1 ppl rlabs 1,0 ppl pen 1,1 ppl color 1 0 0 0 set mode/last verify