Re: Contours overlay problem

From: Will Hobbs <Will.Hobbs_at_nyahnyahspammersnyahnyah>
Date: Wed May 01 2013 - 20:01:17 MDT

Soumik

You should be able to colour your contour lines by setting

sres@cnMonoLineColors = False

getvalues plot@contour ;retrieve contour plot colormap
  "cnFiLLColors" : cols
end getvalues

sres@cnLineColors = cols ;set line colors

The 'getvalues' statement is outlined in a previous post:
http://www.ncl.ucar.edu/Support/talk_archives/2012/0731.html

Obviously, you will have to have already plotted a filled contour base
plot(named 'plot' in my example) or there won't be a colormap to retrieve.
You can then draw the contour lines on a separate plot, and use overlay()
to add it to the base plot.

Will

On 2/05/13 11:48 AM, "Soumik Basu" <sbasu@iarc.uaf.edu> wrote:

>Hi,
>
>I am trying to overlay non shaded contours on shaded contours (this part
>is working fine) but I want my non shaded contour lines to be colored
>following the same color table as the shaded contours. Possibly I am
>missing some resources as a result of which my non shaded contours are
>black.
>
>Is there any example showing that? here is the part of the script
>describing the resources for shaded and non shaded contours.
>
>;************************************************************************
>; Resources for shaded
>;************************************************************************
>res = True
>
>res@gsnDraw = False
>res@gsnFrame = False
>res@gsnMaximize = False
>res@gsnSpreadColors = True
>res@gsnSpreadColors = True ; use full
>colormap
>res@gsnAddCyclic = True
>
>res@cnFillOn = True
>res@cnLinesOn = False
>res@cnLevelSelectionMode = "ManualLevels"
>res@cnMinLevelValF = -1000
>res@cnMaxLevelValF = 1000
>res@cnLevelSpacingF = 50
>res@cnInfoLabelOn = False ; turn off
>cn info label
>res@cnLineLabelsOn = False
>res@cnLineLabelFontHeightF = 0.015
>
>res@tmLabelAutoStride = True
>res@tmXTOn = False
>res@tmYROn = False
>res@tmXBLabelFontHeightF = 0.030
>res@tmYLLabelFontHeightF = 0.030
>
>res@mpLimitMode = "LatLon"
>res@mpMinLatF = 40.
>res@mpMaxLatF = 60.
>res@mpMinLonF = 290.
>res@mpMaxLonF = 380.
>res@mpGeophysicalLineThicknessF = 1.75
>res@mpCenterLonF = 0
>
>res@lbOrientation = "vertical" ;vertical label bar
>res@lbLabelBarOn = False
>res@lbLabelAutoStride = True
>
>;************************************************************************
>; Resources for non shaded
>;************************************************************************
>
>sres = True
>
>sres@gsnDraw = False
>sres@gsnFrame = False
>sres@gsnMaximize = False
>sres@gsnSpreadColors = True
>sres@gsnSpreadColors = True ; use full
>colormap
>sres@gsnAddCyclic = True
>
>sres@cnFillOn = False
>sres@cnLinesOn = True
>sres@cnLevelSelectionMode = "ManualLevels"
>sres@cnMinLevelValF = -1000
>sres@cnMaxLevelValF = 1000
>sres@cnLevelSpacingF = 50
>sres@cnInfoLabelOn = False ; turn off
>cn info label
>sres@cnLineLabelsOn = False
>sres@cnLineLabelFontHeightF = 0.015
>
>sres@tmLabelAutoStride = True
>sres@tmXTOn = False
>sres@tmYROn = False
>sres@tmXBLabelFontHeightF = 0.030
>sres@tmYLLabelFontHeightF = 0.030
>
>sres@lbOrientation = "vertical" ;vertical label bar
>sres@lbLabelBarOn = False
>sres@lbLabelAutoStride = True
>
>
>Thanks,
>Soumik
>
>--
>"Numbing the pain for a while will make it worse when you finally feel
>it.
>~J.K. Rowling"
>*****************************************
>Soumik Basu
>Graduate Student, Research Assistant
>International Arctic Research Center
>University of Alaska Fairbanks
>Fairbanks,Alaska,USA
>*****************************************
>_______________________________________________
>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 May 1 20:01:29 2013

This archive was generated by hypermail 2.1.8 : Thu May 02 2013 - 11:16:45 MDT