<div dir="ltr"><div>Hi Sourav,</div>gsn_contour_shade will simply alter the existing contour field to do what is specified. Thus, you cannot have both color shaded and pattern filled contours for the same set of contours. I recommend creating a second plot (for the pattern filled plot), calling gsn_contour_shade for the 2nd plot, and then overlaying the 2nd plot on the first plot:<div><br></div><div>plot = gsn_csm_contour_map(wks,e_new,res)<br><br>res2 = True</div><div>res2@gsnDraw = False</div><div>res2@gsnFrame = False</div><div>res2@cnLinesOn = False</div><div>res2@cnLineLabelsOn = False</div><div>res2@cnLevelSelectionMode = res@cnLevelSelectionMode<br>res2@cnMinLevelValF = res@cnMinLevelValF<br>res2@cnMaxLevelValF = res@cnMaxLevelValF <br>res2@cnLevelSpacingF = res@cnLevelSpacingF<br><br>oplot = gsn_csm_contour_wks,e_new,res2)</div><div><br>opt = True<br>opt@gsnShadeFillType = "pattern"<br>opt@gsnShadeLow = 3<br>oplot = gsn_contour_shade(oplot,0,-999,opt)<br><br></div><div>overlay(plot,oplot)</div><div>lat_spacing = 5 ; use integers here<br>lon_spacing = 5<br>add_lc_labels(wks,plot,minlat,maxlat,minlon,maxlon,lat_spacing,lon_spacing)<br>draw(plot)<br>frame(wks)<br></div><div><br></div><div>end</div><div><br></div><div>That should at least get you going in the right direction. Hope that helps!</div><div>Adam</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 17, 2019 at 8:50 AM Sourav Chatterjee <<a href="mailto:srvsxc@outlook.com" target="_blank">srvsxc@outlook.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi Users</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I am trying to shade the negative contour values with specified pattern over a map. Although the shade appears correctly but the</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
colour contours are not coming up in the figure. Below is the part of the script and the figure is attached. When gsn_contour_shade<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
is not used it produces the coloured contour plot.</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Any help is appreciated!</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
<div><br>
</div>
<div>wks = gsn_open_wks("eps","shade_negative")<br>
</div>
<div>gsn_define_colormap(wks,"amwg256")<br>
</div>
<div><br>
</div>
<div> res = True<br>
</div>
<div>res@cnFillOn = True<br>
</div>
<div> res@cnLinesOn =False <br>
</div>
<div>res@gsnDraw = False<br>
</div>
<div>res@gsnFrame = False<br>
</div>
<div> res@mpDataBaseVersion = "MediumRes" ; better map outlines<br>
</div>
<div> res@mpGridAndLimbOn = True ; turn on limb and grid lines<br>
</div>
<div>; res@mpGridLineColor = -1 ; ...but don't draw grid lines...<br>
</div>
<div>; res@mpPerimOn = False ; turn off map perimeter<br>
</div>
<div>res@mpFillOn = True<br>
</div>
<div> res@mpFillDrawOrder = "PreDraw" ; draw map fill last<br>
</div>
<div><br>
</div>
<div>res@mpProjection = "LambertConformal"<br>
</div>
<div> res@gsnMaskLambertConformal = True<br>
</div>
<div> res@mpMinLatF = 60<br>
</div>
<div> res@mpMaxLatF = 75<br>
</div>
<div> res@mpMinLonF = -15<br>
</div>
<div> res@mpMaxLonF = 15<br>
</div>
<div> res@mpOutlineBoundarySets = "AllBoundaries"<br>
</div>
<div> res@mpDataSetName = "Earth..3"<br>
</div>
<div>res@tiMainString = ""<br>
</div>
<div>res@cnLevelSelectionMode = "ManualLevels"<br>
</div>
<div>res@cnMinLevelValF = -0.3<br>
</div>
<div>res@cnMaxLevelValF = 0.8<br>
</div>
<div>res@cnLevelSpacingF = 0.02<br>
</div>
<div>res@gsnAddCyclic = False<br>
</div>
<div>res@mpGridLatSpacingF = 5<br>
</div>
<div> res@mpGridLonSpacingF = 5<br>
</div>
<div>res@gsnLeftString = ""<br>
</div>
<div>;res@gsnContourZeroLineThicknessF = 3.5<br>
</div>
<div><br>
</div>
<div><br>
</div>
<br>
<div>plot = gsn_csm_contour_map(wks,e_new,res)<br>
</div>
<div><br>
</div>
<div>opt = True<br>
</div>
<div>opt@gsnShadeFillType = "pattern"<br>
</div>
<div>opt@gsnShadeLow = 3<br>
</div>
<div>plot = gsn_contour_shade(plot,0,-999,opt)<br>
</div>
<div>delete(opt@gsnShadeLow)<br>
</div>
<div><br>
</div>
<div>;---Attach latitude labels<br>
</div>
<div> lat_spacing = 5 ; use integers here<br>
</div>
<div> lon_spacing = 5<br>
</div>
<div> add_lc_labels(wks,plot,minlat,maxlat,minlon,maxlon,lat_spacing,lon_spacing)<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>;---Drawing the plot will also draw all the attached labels.<br>
</div>
<div> draw(plot)<br>
</div>
<div> frame(wks)<br>
</div>
<div><br>
</div>
<div>exit<br>
</div>
<div>end<br>
</div>
<div><br>
</div>
<span></span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Regards</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Sourav<br>
</div>
</div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_3870874265175447354gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist, </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>