<div dir="ltr">Hi Melissa,<div>Please remember to always copy ncl-talk on any responses so that the group can see them. In your offline reply you state that you want white to be designated to the value of 0. Within your script you have this: res@ContourParameters = (/0.0, max(qc_plane), 0.01 /) indicating a contour spacing of 0.01, but the labelbar shows the contour spacing being 0.1. Are you receiving any error messages? There is a limit to the number of contours you can have (256 I believe), and I am wondering if you are hitting it, and NCL is ignoring your input settings. </div><div><br></div><div>Getting back to your question, if you want values near 0.0 to be colored white, and with ContourParameters not allowing you to explicitly select levels that aren't separated by a constant value, there's limited options here. The easiest suggestion I would make would be to not start your contour levels at 0.;  start them at 0.01 (as you seem to want a contour interval of 0.01). This would result in all values less than 0.01 being shaded white. Thus:</div><div><div>res@ContourParameters = (/0.01,2.55, 0.01 /)</div></div><div><br></div><div>Alternatively, if you want only values exactly = 0.0 to be white, then the best method might be to set all values = 0 to _FillValue (as cells set to _FillValue will be shaded white by default). You can accomplish this using a where statement:</div><div><span style="font-family:georgia,serif;font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">qc_plane = where(<span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">qc_plane.eq.0, <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">qc_plane</span>@_FillValue,<span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">qc_plane)</span></span></span><br></div><div><span style="font-family:georgia,serif;font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-family:Arial,Helvetica,sans-serif;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">and then you can set your contour levels to whatever you want, and eliminate white from your colormap as I referenced in my last email (and Barry sent a coding example about).</span></span></span></span></div><div><span style="font-family:georgia,serif;font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-family:Arial,Helvetica,sans-serif;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></span></span></div><div><span style="font-family:georgia,serif;font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-family:Arial,Helvetica,sans-serif;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">If the above does not help, let ncl-talk know.</span></span></span></span></div><div><span style="font-family:georgia,serif;font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-family:Arial,Helvetica,sans-serif;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Adam</span></span></span></span></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 2, 2018 at 4:26 AM Barry Lynn <<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Here's an example.<div><br></div><div>




<span></span>





<p class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:22px;line-height:normal;font-family:"Courier New";color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-Apple-converted-space">  </span>cmap := read_</span><span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-s2" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(230,230,0)">color</span><span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-s1" style="font-variant-ligatures:no-common-ligatures">map_file("NCV_rainbow2")</span></p>
<p class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:22px;line-height:normal;font-family:"Courier New";color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-Apple-converted-space">  </span>cmap := cmap(50:, :)</span></p>
<p class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:22px;line-height:normal;font-family:"Courier New";color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-Apple-converted-space">  </span>cmap(0,:) = 1. <span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-Apple-converted-space">  </span>; Make first </span><span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-s2" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(230,230,0)">color</span><span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-s1" style="font-variant-ligatures:no-common-ligatures"> white</span></p>
<p class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:22px;line-height:normal;font-family:"Courier New";color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-Apple-converted-space">  </span>opts_Prec@cnFillPalette <span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-Apple-converted-space">    </span>= cmap <span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-Apple-converted-space">        </span>; set </span><span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-s2" style="font-variant-ligatures:no-common-ligatures;background-color:rgb(230,230,0)">color</span><span class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail-s1" style="font-variant-ligatures:no-common-ligatures"> map</span></p>


<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 2, 2018 at 7:52 AM Adam Phillips <<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Melissa,<div>If all you want is white to not be the first color in your labelbar, you can read in your colormap using read_colormap_file, and then specify a subset of the colormap (eliminating white) in cnFillPalette. See example #8 here:</div><div><a href="http://www.ncl.ucar.edu/Applications/rgbacolor.shtml#ex8" target="_blank">http://www.ncl.ucar.edu/Applications/rgbacolor.shtml#ex8</a><br></div><div><br></div><div>Hope that helps. If not or if you have further questions please respond to the ncl-talk email list.</div><div>Adam</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jul 31, 2018 at 4:06 PM MELISSA KAZEMI RAD <<a href="mailto:mk1369@scarletmail.rutgers.edu" target="_blank">mk1369@scarletmail.rutgers.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">Hi,</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">I'm trying to create a panel contour plot of cloud liquid water, and I particularly want to have as many contour levels as possible, i.e. I need to be able to show the smallest amount of cloud water. In order to do so, I've set:</div><div class="gmail_default" style="font-family:georgia,serif">res@ContourParameters = (/0.0, max(qc_plane), 0.01 /)</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">However, the plots that I get don't have any designated color for 0 value.</div><div class="gmail_default" style="font-family:georgia,serif">I use a similar code to produce one such plot (instead of a panel plot), and it works fine, in the sense that I can divide the panel bar to the number of contour levels.<br></div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">Here is my NCL code and the plot that I get: (NCL.6.4.0)<br></div><div class="gmail_default" style="font-family:georgia,serif"><br clear="all"></div>    type = "png"<br><br>   wks = gsn_open_wks(type,"Cloud_panel")<br><br>   times  = wrf_user_list_times(a)<br>   time = 166<br><br>    p    = wrf_user_getvar(a, "pressure", time)    ; Total Pressure<br>    z    = wrf_user_getvar(a,"z",time)<br>    qc   = wrf_user_getvar(a,"QCLOUD", time)<br><br>    qc       = qc*1000.<br>    qc@units = "g/kg"<br><br>    res                          = True<br>    res@NoHeaderFooter           = True<br><br>    pltres                  = True<br>    pltres@PanelPlot        = True<br>    mpres                   = True<br><br>  ; Generate Contours<br><br>    height_levels = (/750., 1000., 1200, 1400./)   ; heigth levels to plot<br>    nlevels         = dimsizes(height_levels)     ; number of height levels<br>    nplots     = 4<br>    plots      = new(nplots,"graphic")<br>    iplot      = 0<br><br>    do level  = 0,nlevels-1<br>       res@cnFillOn            = True<br>       res@cnFillPalette       = "WhViBlGrYeOrRe"<br><div style="font-family:georgia,serif" class="gmail_default">       res@lbLabelBarOn        = False<br>       res@cnLinesOn           = False<br>       res@cnLevelSpacingF     = 0.1<br><br>       height = height_levels(level)<br>       qc_plane = wrf_user_intrp3d(qc,z,"h",height,0.,False)<br><br>       res@ContourParameters = (/0.0, max(qc_plane), 0.01 /)<br><br>       contour = wrf_contour(a,wks,qc_plane,res)<br>       pltres@CommonTitle      = True<br>       pltres@PlotTitle        = height+"m"<br>       plots(iplot) = wrf_map_overlays(a, wks, (/contour/), pltres, mpres)<br>       delete(contour)<br>       iplot = iplot + 1<br>    end do<br><br>  ; Panel the WRF Plots<br>    pnlres                            = True<br>    pnlres@txString                   = qc@description + "  (" + qc@units + ")"+ "at" + " at "+  times(time)<br>    pnlres@gsnPanelYWhiteSpacePercent = 10       ; Add white space b/w plots.<br>    pnlres@gsnPanelLabelBar           = True    ; Turn on common labelbar<br><br>    pnlres@lbLabelAlignment           = "BoxCenters"<br>    pnlres@lbLabelsOn           = True<br>    pnlres@lbPerimOn            = False<br>    pnlres@lbTitleOn            = False</div><div style="font-family:georgia,serif" class="gmail_default"><br></div><div style="font-family:georgia,serif" class="gmail_default">    pnlres@pmLabelBarWidthF           = 0.6<br><br>    gsn_panel(wks,(/plots/),(/2,2/),pnlres)<br><br>end<br></div><br>-- <br><div class="m_-8552235412541939165m_3915244235255615034m_4455841737111256325m_6855671812235085374m_-5085423883118115343gmail_signature"><div dir="ltr"><font face="georgia, serif"><i>Melissa Kazemi Rad</i></font><div><font face="georgia, serif"><i>Atmospheric Sciences Department</i></font></div><div><font face="georgia, serif"><i>Rutgers University</i></font></div></div></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="m_-8552235412541939165m_3915244235255615034m_4455841737111256325m_6855671812235085374gmail_signature" data-smartmail="gmail_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>
_______________________________________________<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="m_-8552235412541939165m_3915244235255615034m_4455841737111256325gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Associate Scientist, Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br><br></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-8552235412541939165m_3915244235255615034gmail_signature" data-smartmail="gmail_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>