Re: black and white and color shading polar plot without grid lines

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Mon Dec 17 2012 - 18:05:19 MST

Hi Waqar,
ShadeLtGtContour fills a contour plot with 2 patterns, and not 2 colors.
See the example plots linked at the bottom of the ShadeLtGtContour
documentation page here:
http://www.ncl.ucar.edu/Document/Functions/Shea_util/ShadeLtGtContour.shtml

Thus I don't believe that that is the procedure you wish to use. Also
note at the top of the documentation page that this procedure is
deprecated; it is suggested that you use gsn_contour_shade instead.

Take a look at example #2 from the gsn_contour_shade page, as it shows
how to do what you want.
http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_contour_shade.shtml

To remove the latitude/longitude lines, set res@mpGridandLimbOn = False
http://www.ncl.ucar.edu/Document/Graphics/Resources/mp.shtml#mpGridandLimbOn

To remove the longitude labels, set res@gsnPolarLabelFontHeightF = 0.
http://www.ncl.ucar.edu/Document/Graphics/Resources/gsn.shtml#gsnPolarLabelFontHeightF

To set the line colors, along with the negative contours to dash, use
ColorNegDashZeroPosContour after you call gsn_contour_shade:
http://www.ncl.ucar.edu/Document/Functions/Shea_util/ColorNegDashZeroPosContour.shtml

If that does not totally answer your questions, please let ncl-talk know.
Adam

On 12/17/12 2:28 PM, Waqar Younas wrote:
> Hi everyone,
> I want to plot the same figure as attached with this email. This
> figure is taken from a paper. I have same data used in the paper
> figure (first two rotated EOF of NH 500mb monthly data from 1950-2000)
> and my figure is also attached. You can notice this figure does not
> contain any grid lines with value with dashed negative contours
> (black) and solid positive contours (grey). Also, i want the same
> figure in color (Red for positive and blue for negative).
> To plot my figure i use the following.
> ;============================================================
> ; PLOTS
> ;============================================================
> wks = gsn_open_wks("ps","test1")
>
> gsn_define_colormap(wks,"BlueWhiteOrangeRed")
> plot = new(neof,graphic) ; create graphic array
> ; only needed if paneling
> ; EOF patterns
>
> res = True
> res@gsnDraw = False ; don't draw yet
> res@gsnFrame = False ; don't advance frame yet
> res@gsnPolar = "NH"
> res@gsnSpreadColors = True ; spread out color table
>
> res@mpFillOn = False ; turn off map fill
> res@mpMaxLatF = latN
> res@mpMinLatF = 20
> res@mpCenterLonF = -90
>
> res@cnFillOn = True ; turn on color fill
> res@cnLinesOn = True ; True is default
> res@cnLineLabelsOn = True ; True is default
> res@lbLabelBarOn = True ; turn off individual lb's
>
> ; set symmetric plot min/max
> symMinMaxPlt(ev_rot, 16, False, res) ; contributed.ncl
> res@cnLevelSpacingF = 10 ; *special* match CPC
>
> ; panel plot only resources
>
> resP = True ; modify the panel plot
> resP@gsnMaximize = True ; large format
> resP@gsnPanelLabelBar = False ; add common colorbar
> resP@gsnPaperOrientation = "portrait" ; force portraitorbar
> resP@lbLabelAutoStride = True ; auto stride on labels
>
> resP@txString = title+": "+yrStrt+"-"+yrLast+" by
> regressing Rotated EOF on anomalies"
>
> ;*******************************************
> ; first plot
> ;*******************************************
> res@gsnLeftString = "EOF "+(0+1)
> res@gsnRightString = sprintf("%5.1f", ev_rot@pcvar_varimax(0)) +"%"
> plot(0)=gsn_csm_contour_map_polar(wks,ev_regres(0,:,:),res)
> plot(0) = ShadeLtGtContour(plot(0), -10,10,11.5,17)
>
> res@gsnLeftString = "EOF "+(1+1)
> res@gsnRightString = sprintf("%5.1f", ev_rot@pcvar_varimax(1)) +"%"
> plot(1)=gsn_csm_contour_map_polar(wks,ev_regres(1,:,:),res)
> plot(1) = ShadeLtGtContour(plot(1), -10,10,11.5,17)
>
>
> gsn_panel(wks,plot,(/2,1/),resP) ; now draw as one plot
>
> where ev_regres are my rotated patterns having spatial dimensions
> (0-87.5N).
>
>
> Any help would be highly appreciable.
>
>
> --
> Best Regards
>
> Waqar Younas
> PhD Candidate
> Natural Resources and Environmental Studies (NRES)
> University of Northern British Columbia (UNBC)
> Canada
>
>
>
> _______________________________________________
> 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 Mon Dec 17 18:05:33 2012

This archive was generated by hypermail 2.1.8 : Fri Dec 21 2012 - 10:43:23 MST