c subroutine yaxright(yax_l,yax_r,ny,ynum,nynum,form,int,fcode, + nmnr,lab,rofftoax,rofftolab,rchsize) c c Draw extra right-hand axis: c real yax_l(ny),yax_r(ny),ynum(nynum) character*(*) form,lab,fcode(nynum) data ticlen/.012/, spval/1.e36/ c c Offset from existing right axis to new right axis is given in normalized c coords. Set offsets to numeric labels and axis info label: c offtoax = .015 if (rofftoax.gt.0.) offtoax = rofftoax offtolab = offtoax+.09 if (rofftolab.gt.0) offtolab = rofftolab offtonum = offtoax+.02 chsize = .014 if (rchsize.gt.0.) chsize = rchsize c c write(6,"('yaxright: ny=',i3,' yax_l=',/(6e12.4))") ny,yax_l c write(6,"('yaxright: ny=',i3,' yax_r=',/(6e12.4))") ny,yax_r c write(6,"('yaxright: nynum=',i3,' ynum=',/(6e12.4))") nynum, c + ynum c c Get into normalized 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 the axis: c xpos = vr+offtoax call line(xpos,vb,xpos,vt) c c Draw numeric labels, tics, and info label: c nmjr = 0 do k=1,nynum call vecterp(yax_r,yax_l,ny,ynum(k),yval,1,spval,0) if (yval.eq.spval) goto 100 ypos = vb+(vt-vb)*(yval-yax_l(1))/(yax_l(ny)-yax_l(1)) if (ypos.le.vt.and.ypos.ge.vb) then ynumcur = ynum(k) nmjr = nmjr+1 c write(6,"('k=',i2,' nmjr=',i2,' ynum(k)=',1pe9.3,' ypos=', c + f7.4,' yax_l(1),(ny)=',2(1pe9.2))") c + k,nmjr,ynum(k),ypos,yax_l(1),yax_l(ny) call line(xpos,ypos,xpos+ticlen,ypos) ! major tic mark call drnum(ynum(k),int,form,fcode(k), ! numeric label + vr+offtonum,ypos,chsize) c c Draw minor tic marks: c if (nmnr.gt.0.and.nmjr.ge.2) then c write(6,"('calling drmnr: ynum(k)=',1pe9.3,' ynumprev=', c + 1pe9.3)") ynum(k),ynumprev call drmnr(ynum(k),ynumprev,nmnr,vb,vt,yax_l,yax_r,ny, + xpos,ticlen,spval) del = ynum(k)-ynumprev if (nmjr.eq.2) then ! minor tics below bottom major sign = 1. if (del.gt.0.) sign = -1. call drmnr(ynumprev,ynumprev+sign*del,nmnr, + vb,vt,yax_l,yax_r,ny,xpos,ticlen,spval) endif endif ! nmjr >= 2 ynumprev = ynum(k) endif ! ypos for major is on axis 100 continue enddo c c Minor tics above top major: c if (nmnr.gt.0) then sign = 1. if (del.lt.0.) sign = -1. c write(6,"('above top major: ynumcur=',1pe9.2,' del=',1pe9.2, c + ' sign=',f6.2)") ynumcur,del,sign call drmnr(ynumcur+sign*del,ynumcur,nmnr, + vb,vt,yax_l,yax_r,ny,xpos,ticlen,spval) endif c c Axis string 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 c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c subroutine drnum(ynum,int,form,fcode,xpos,ypos,chsize) character*(*) form,fcode character*32 labnum if (lenstr(form).gt.0) then if (int.gt.0) then ! form is for integers write(labnum,form) ifix(ynum) else write(labnum,form) ynum endif call plchmq(xpos,ypos,labnum(1:lenstr(labnum)), + chsize,0.,-1.) else call plchhq(xpos,ypos,fcode(1:lenstr(fcode)), + chsize,0.,-1.) endif return end c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c subroutine drmnr(ytop,ybot,nmnr,vb,vt,yax_l,yax_r,ny,xpos, + ticlen,spval) real yax_l(ny),yax_r(ny) c dmnr = (ytop-ybot)/float(nmnr) do i=1,nmnr-1 ! minor tics between pair of major tics if (dmnr.lt.0.) then ymnrval = ytop+float(i)*dmnr else ymnrval = ytop-float(i)*dmnr endif call vecterp(yax_r,yax_l,ny,ymnrval,yval,1,spval,0) if (yval.ne.spval) then ypos = vb+(vt-vb)*(yval-yax_l(1))/(yax_l(ny)-yax_l(1)) if (ypos.le.vt.and.ypos.ge.vb) then call line(xpos,ypos,xpos+0.5*ticlen,ypos) c write(6,"('drmnr on axis: i=',i2,' ytop,bot=', c + 2(1pe9.2),' dmnr=',1pe9.3,' ymnrval=',1pe9.2,' ypos=', c + f7.4)") i,ytop,ybot,dmnr,ymnrval,ypos else c write(6,"('drmnr off axis: i=',i2,' ytop,bot=', c + 2(1pe9.2),' dmnr=',1pe9.3,' ymnrval=',1pe9.2,' ypos=', c + f7.4)") i,ytop,ybot,dmnr,ymnrval,ypos endif else c write(6,"('dmnr yval==spval: i=',i2,' ymnrval=',1pe9.3, c + ' dmnr=',1pe9.3)") i,ymnrval,dmnr endif enddo return end