c c------------------------------------------------------------------ c subroutine specyax(yax_l,yax_r,ny,ynum,nynum,form,fcode,lab) c c Add right hand y-axis labeled with ynum(nynum), interpolated from c yax_r(ny) (use form format for numeric labels) c Use format "form" for numeric labels ynum, *unless* form is blank, c in which case use "fcode", which will be strings containing function c codes to pass to plchhq c Label new y-axis with information label "lab" c dimension yax_r(ny),yax_l(ny),ynum(nynum),yloc(nynum) character*(*) lab,form,fcode(nynum) character*32 labnum data ticlen /.012/, chsize/.014/ c c offtoax is offset from existing right axis to new axis c offtonum is offset from existing right axis to new axis numerics c offtolab is offset from existing right axis to new axis label c data offtonum/.02/, offtoax/.015/, offtolab/.09/ c do k=1,nynum call bracket(ynum(k),yax_r,ny,-1,k0,k1,ier) f1 = (ynum(k)-yax_r(k0)) / (yax_r(k1)-yax_r(k0)) yloc(k) = f1*yax_l(k1) + (1.-f1)*yax_l(k0) enddo c write(6,"('specyax: ny=',i3,' yax_r=',/(6e12.4))") ny,yax_r c write(6,"('specyax: ny=',i3,' yax_l=',/(6e12.4))") ny,yax_l c write(6,"('specyax: nynum=',i3,' ynum=',/(6e12.4))") nynum,ynum c write(6,"('specyax: yloc=',/(6e12.4))") yloc c c Save current set, and get into fractional coords: c call getset(vl,vr,vb,vt,wl,wr,wb,wt,lty) call set(0.,1.,0.,1.,0.,1.,0.,1.,1) c c Draw new axis: c xpos = vr+offtoax call line(xpos,vb,xpos,vt) c c Add tic marks and label numerics: c do k=1,nynum ypos = vb + (vt-vb)*(yloc(k)-yax_l(1))/(yax_l(ny)-yax_l(1)) if (ypos.gt.vt.or.ypos.lt.vb) goto 100 c write(6,"('specyax: k=',i2,' yloc(k)=',e12.4,' ypos=',e12.4)") c + k,yloc(k),ypos call line(xpos,ypos,xpos+ticlen,ypos) if (lenstr(form).gt.0) then write(labnum,form) ynum(k) call plchmq(vr+offtonum,ypos,labnum,chsize,0.,-1.) else call plchhq(vr+offtonum,ypos,fcode(k)(1:lenstr(fcode(k))), + chsize,0.,-1.) endif 100 continue enddo c c Add axis label: c call plchmq(vr+offtolab,0.5*(vt+vb),lab,chsize,90.,0.) c c Restore original set: c call set(vl,vr,vb,vt,wl,wr,wb,wt,lty) return end