Re: setting gsnYRefLine offsets X axis?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Apr 03 2013 - 15:36:06 MDT

Hi Nick,

When gsnYRefLine is in use, then the X axes is set to the min/max of the X axis values, rather than letting NCL pick the data values. This is because it doesn't want to draw the Y reference line beyond that actual range of your data.

You might try setting trXMinF and trXMaxF (for all plots) to the same min/max X axis of the plot that contains the reference line.

--Mary

On Apr 3, 2013, at 2:50 PM, Nick Guy wrote:

> Hi all,
>
> I am creating a panel plot with the code below. It works just fine until the gsnYRefLine is turned on in the 3rd plot. When this resource is set the x-axis is now formatted differently than the other three plots.
> The reference lines are drawn properly and then deleted. Only the x-axis changes.
>
> Am I missing something?
> Thanks,
>
> ***********************************************************************************************
> wksCS=gsn_open_wks("ps",pCSname)
> csPlot=new(4,graphic)
>
> PIPsec=PIPEpoch-PIPEpoch(0)
> ; **Plot Rain Rate**
> resCS=True
> resCS@gsnDraw=False
> resCS@gsnFrame=False
> resCS@gsnLeftString=RR_PIP_ts@long_name
> resCS@gsnRightString=Txright
> resCS@xyLineThicknessF=2
> resCS@tiXAxisString=" "
> resCS@tiYAxisString=RR_PIP_ts@units
> resCS@vpHeightF=.2
> resCS@vpWidthF=.8
> resCS@tmXBMode="Manual"
> resCS@tmXBMinorPerMajor=4
> resCS@tmXBLabelsOn=True
> resCS@xyMarkLineMode="Markers"
> resCS@xyMarker=16
> resCS@xyMarkerSizeF=.002
>
> ; Set the time_axis_label resources
> resTax=True
> resTax@ttmAxis="XB"
> resTax@ttmFormat="%H:%M"
> resTax@ttmNumTicks=10
> ; time_axis_labels(PIPEpoch,resCS,resTax)
> ;***1st PLOT***
> csPlot(0)=gsn_csm_xy(wksCS,PIPsec,RR_PIP_ts(:,0),resCS)
>
> ; ****2nd PLOT**** - Redefine some resources
> resCS@gsnLeftString=Z_PIP@long_name
> resCS@tiYAxisString="dBZ"
> csPlot(1)=gsn_csm_xy(wksCS,PIPsec,10.*log10(Z_PIP_ts(:,0)),resCS)
>
> ; ****3rd PLOT**** - Redefine some resources
> resCS@gsnLeftString=PIP_W@long_name
> resCS@tiYAxisString=PIP_W@units
> resCS@gsnYRefLine=(/Wthresh,-1*Wthresh/)
> resCS@gsnYRefLineColor="gray"
> csPlot(2)=gsn_csm_xy(wksCS,PIPsec,PIP_W,resCS)
> delete([/resCS@gsnYRefLine,resCS@gsnYRefLineColor/])
>
> ; ****4th PLOT****
> resCS@trYMinF=0.
> resCS@trYMaxF=3.
> resCS@tmYLMode="Explicit"
> resCS@tmYLValues=(/0,1,2,3/)
> resCS@tmYLLabels=(/" ","S","C"," "/)
> resCS@gsnLeftString="A00 - black; B09 - green"
> resCS@tiYAxisString="Rain Type"
> resCS@tiXAxisString="Minutes from RCE module start"
> csPlot(3)=gsn_csm_xy(wksCS,PIPsec,A00_cs,resCS)
>
> ; Now overlay other 3 methods
> resCSMark=True
> resCSMark@gsMarkerIndex=16
> resCSMark@gsMarkerColor="blue"
> resCSMark@gsMarkerSizeF=.002
> mk2=gsn_add_polymarker(wksCS,csPlot(3),PIPsec,T01_cs+.25,resCSMark)
> resCSMark@gsMarkerColor="red"
> mk3=gsn_add_polymarker(wksCS,csPlot(3),PIPsec,B03_cs+.125,resCSMark)
> resCSMark@gsMarkerColor="green"
> mk4=gsn_add_polymarker(wksCS,csPlot(3),PIPsec,B09_cs-.125,resCSMark)
>
> ; ****Create Panel Plot*****
> presCS=True
> presCS@gsnPanelFigureStrings=(/"a)","b)","c)","d)"/)
> presCS@amJust="TopRight"
> presCS@gsnPanelYWhiteSpacePercent=3
> gsn_panel(wksCS,csPlot,(/4,1/),presCS)
>
> delete([/mk2,mk3,mk4,csPlot/])
> ***********************************************************************************************
> Nick Guy, Ph.D.
> NOAA National Severe Storms Laboratory
> NOAA/NSSL/WRDD
> 120 David L. Boren Blvd.
> Norman, OK 73072
> (405)325-6287
> nick.guy@noaa.gov
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Apr 3 15:36:20 2013

This archive was generated by hypermail 2.1.8 : Thu Apr 04 2013 - 21:06:41 MDT