<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Mira,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">First, if you are truly using NCL V6.0.0, then I recommend upgrading because this is pretty old. Also, the cnFillPalette resource was added in NCL V6.1.0, so it doesn't surprise me if it's not working with NCL V6.0.0.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you actually do have NCL V6.2.0 or later, then something is wrong, because your script works for me with a few minor changes:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><ul><li>I don't have a <a href="http://SLP.mon.mean.nc">SLP.mon.mean.nc</a> file, but I have a similar one.<br><br></li><li>My pressure values are in mb, so I had to scale the contour levels accordingly.<br><br></li><li>I removed this line:</li></ul></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-size:small"><p class="gmail-p1"><span class="gmail-s1">res@</span><span class="gmail-s2">cnFillColo</span><span class="gmail-s3">rs</span><span class="gmail-s1"> = </span><span class="gmail-s4">(/</span><span class="gmail-s1"> 23,30,36,41,45,-1,59,63,68,74</span><span class="gmail-s4">/)</span><span class="gmail-s1"> </span><span class="gmail-s5">; set the colors to be used </span></p></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-size:small"><p class="gmail-p1">Because you shouldn't need to do this since you are setting:</p></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-size:small"><p class="gmail-p1">res@cnFillPalette = "BlWhRe"</p></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-size:small"><p class="gmail-p1">NCL will automatically span the full color map, and you should get white in the middle since you chose the contour levels correctly. See the attached image.</p></div></blockquote><div class="gmail_default"><p class="gmail-p1" style="font-size:small">If you want to upgrade your version of NCL, then I recommend downloading NCL V6.4.0. See our release notes and download page:</p><p class="gmail-p1"><a href="http://www.ncl.ucar.edu/current_release.shtml">http://www.ncl.ucar.edu/current_release.shtml</a><br><a href="http://www.ncl.ucar.edu/Download/">http://www.ncl.ucar.edu/Download/</a></p><p class="gmail-p1">--Mary</p><p class="gmail-p1"><br></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 10, 2017 at 1:35 PM, MIRA BERDAHL <span dir="ltr"><<a href="mailto:mlosic@scarletmail.rutgers.edu" target="_blank">mlosic@scarletmail.rutgers.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi All,<div><br><div>I'm working with NCL v. 6.0.0. I am trying to make a 3 panel plot, with filled contours. However, when I try to set explicit colors for the third panel (I would like to do a Red-White-Blue theme, centered on a white zero), I cannot get the appropriate colors plotted. I am using con_Lev_4.ncl as an example (<a href="http://www.ncl.ucar.edu/Applications/contourLev.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/contourLev.shtml</a>)<wbr>.</div><div><br></div><div>I have also tried setting this to manual levels with a max, min and interval for the contours and using a prescribed color table, such as hotcold_18lev, but the colormap defaults to the same as the top two panels.</div><div><br></div><div>I've copied my script here, and the output figure is attached. </div><div>Does anyone have ideas on how to change this third panel so the colors are Red-White-Blue themed? </div><div><br></div><div>Thanks,</div><div>Mira</div><div><br></div><div><br></div><div><br></div><div><br></div><div><div><br></div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl" </div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl" </div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl" </div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/shea_util.ncl" </div><div>;*****************************<wbr>******************* </div><div>begin </div><div>;*****************************<wbr>******************* </div><div>; read in netCDF files</div><div>;*****************************<wbr>******************* </div><div>a = addfile("<a href="http://SLP.mon.mean.nc" target="_blank">SLP.mon.mean.nc</a>","r") ; sea level pressure </div><div><br></div><div>;*****************************<wbr>******************* </div><div>; read in zonal [u] and meridional [v] moisture transport (water vapor)</div><div>;*****************************<wbr>******************* </div><div><br></div><div>slp = a->PRMSL_GDS0_MSL_S123(1:648,:<wbr>,:) </div><div><br></div><div><br></div><div>;*****************************<wbr>******************************<wbr>****</div><div>; geneerate a new longitude list that is monotonically increasing</div><div>;*****************************<wbr>******************************<wbr>****</div><div>g0_lat_1 = a->g0_lat_1</div><div>g0_lon_2 = a->g0_lon_2</div><div>g0_lon_2 = where(g0_lon_2.gt.180, g0_lon_2-360, g0_lon_2); change it from 220to 30 to be -110 to 30</div><div>g0_lon_2&g0_lon_2 = g0_lon_2</div><div>printVarSummary(g0_lon_2)</div><div><br></div><div>slp&g0_lon_2 = g0_lon_2 ; replace with 'correct' ordering</div><div>slp&g0_lon_2 = g0_lon_2</div><div><br></div><div>printVarSummary(slp)</div><div><br></div><div><br></div><div>; Calculate the seasonal averages.</div><div>slpDJF = month_to_season(slp, "DJF")</div><div><br></div><div>printVarSummary(slpDJF)</div><div><br></div><div><br></div><div>; this data starts at 1958 (this is index 0), so 1963=5, 1973=15 etc.</div><div><br></div><div><br></div><div>slpDJF_lon_hi = slpDJF((/8,10,11,16,25,26,36,<wbr>37,41,47/),:,:)</div><div>slpDJF_lon_lo = slpDJF((/5,6,22,27,29,33,34,<wbr>38,45,48/),:,:)</div><div><br></div><div>slpAvgTime_hi = dim_avg_n_Wrap(slpDJF_lon_hi,<wbr>0)</div><div>slpAvgTime_lo = dim_avg_n_Wrap(slpDJF_lon_lo,<wbr>0)</div><div><br></div><div>printVarSummary(slpAvgTime_hi)</div><div>printVarSummary(slpAvgTime_lo)</div><div><br></div><div><br></div><div>; sneaky way to copy metadata over first.</div><div>diff_slp = slpAvgTime_hi;</div><div>diff_slp = slpAvgTime_lo - slpAvgTime_hi</div><div><br></div><div>printVarSummary(diff_slp)</div><div><br></div><div><br></div><div>;*****************************<wbr>******************* </div><div>; create plot </div><div>;*****************************<wbr>******************* </div><div>wks = gsn_open_wks("ps","Panel_lon_<wbr>SLP") <span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                </span>; open a ps file </div><div>gsn_define_colormap(wks,"<wbr>temp1")</div><div><br></div><div>plot = new(3,graphic)<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>; create a plot array</div><div><br></div><div>;---- set common resources for all plots</div><div>res <span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                        </span>= True</div><div>res@gsnDraw<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                </span>= False <span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                </span>; dont draw</div><div>res@gsnFrame<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                </span>= False<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                        </span>; dont advance frame</div><div>res@cnInfoLabelOn<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>= False<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                        </span>; trn off cn info label</div><div>res@gsnAddCyclic = False<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                </span>; has to do with wrapping the lonitude at 0/360</div><div>res@cnFillPalette = "matlab_jet"</div><div><br></div><div><br></div><div>;;****************************<wbr>******************** </div><div>;; Choose a subregion </div><div>;;****************************<wbr>******************** </div><div>res@mpMaxLatF = 90 <span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>;maximum latitude </div><div>res@mpMinLatF = 25 <span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>;minimum latitude </div><div>res@mpMaxLonF = 30<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>; max lon</div><div>res@mpMinLonF = -110<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>; min lon</div><div>res@mpOutlineBoundarySets = "National"</div><div>res@mpOutlineOn = True<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>; turn map outline on</div><div>res@mpOutlineDrawOrder = "PostDraw"</div><div>res@mpFillOn = False<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>; turn map fill off</div><div>res@cnFillOn = True<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>; turn on color fill</div><div>res@cnLinesOn = False<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>; turn off contour lines</div><div>res@lbOrientation = "Vertical"<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                        </span>; make labels vertical</div><div>res@cnFillPalette = "BlWhRe"</div><div>res@cnLevelSelectionMode = "ManualLevels"<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>; set manual contour levels</div><div>res@cnMinLevelValF = 100000<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                        </span>; set min contour level</div><div>res@cnMaxLevelValF = 102400<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                        </span>; set max countrou level</div><div>res@cnLevelSpacingF = 400<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                        </span>; set contour spacing</div><div><br></div><div><br></div><div>plot(0) = gsn_csm_contour_map(wks,<wbr>slpAvgTime_hi,res)</div><div>plot(1) = gsn_csm_contour_map(wks,<wbr>slpAvgTime_lo,res)</div><div><br></div><div>delete(res@cnLevelSpacingF)<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                        </span>; delete resources before reseting</div><div>res@cnLevelSelectionMode = "ExplicitLevels" ;<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>set explicit contour levels</div><div>res@cnLevels = (/ -900, -700., -500., -300., -100., 100., 300., 500., 700., 900./) ; set levels</div><div>res@cnFillColors = (/ 23,30,36,41,45,-1,59,63,68,74/<wbr>) ; set the colors to be used</div><div><br></div><div>plot(2) = gsn_csm_contour_map(wks,diff_<wbr>slp,res)</div><div><br></div><div><br></div><div>;*****************************<wbr>*******************</div><div>; create panel</div><div>;*****************************<wbr>*******************</div><div>resP = False<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                        </span>; modify the panel plot</div><div>resP@txString = "lon - SLP"</div><div>gsn_panel(wks,(/plot/),(/3,1/)<wbr>,resP)<span class="m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                </span>; now draw as one plot;</div><div> </div><div><br></div><div>end </div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>