<div dir="ltr">Hi Mary,<br>Thanks very much for doing this test with your data and the newest version of NCL.<div>I will try to download the 6.4.0 and hopefully this is more straightforward then.</div><div>Best,</div><div>Mira</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 10, 2017 at 2:16 PM, Mary Haley <span dir="ltr">&lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt;</span> wrote:<br><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-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&#39;t surprise me if it&#39;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&#39;t have a <a href="http://SLP.mon.mean.nc" target="_blank">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><span class=""><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-size:small"><p class="m_-7959927968114249044gmail-p1"><span class="m_-7959927968114249044gmail-s1">res@</span><span class="m_-7959927968114249044gmail-s2">cnFillColo</span><span class="m_-7959927968114249044gmail-s3">rs</span><span class="m_-7959927968114249044gmail-s1"> = </span><span class="m_-7959927968114249044gmail-s4">(/</span><span class="m_-7959927968114249044gmail-s1"> 23,30,36,41,45,-1,59,63,68,74</span><span class="m_-7959927968114249044gmail-s4">/<wbr>)</span><span class="m_-7959927968114249044gmail-s1">  </span><span class="m_-7959927968114249044gmail-s5">; set the colors to be used                                                            </span></p></div></blockquote></span><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-size:small"><p class="m_-7959927968114249044gmail-p1">Because you shouldn&#39;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="m_-7959927968114249044gmail-p1">res@cnFillPalette = &quot;BlWhRe&quot;</p></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-size:small"><p class="m_-7959927968114249044gmail-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="m_-7959927968114249044gmail-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="m_-7959927968114249044gmail-p1"><a href="http://www.ncl.ucar.edu/current_release.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>current_release.shtml</a><br><a href="http://www.ncl.ucar.edu/Download/" target="_blank">http://www.ncl.ucar.edu/<wbr>Download/</a></p><span class="HOEnZb"><font color="#888888"><p class="m_-7959927968114249044gmail-p1">--Mary</p><p class="m_-7959927968114249044gmail-p1"><br></p></font></span></div></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Fri, Mar 10, 2017 at 1:35 PM, MIRA BERDAHL <span dir="ltr">&lt;<a href="mailto:mlosic@scarletmail.rutgers.edu" target="_blank">mlosic@scarletmail.rutgers.<wbr>edu</a>&gt;</span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi All,<div><br><div>I&#39;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/Appli<wbr>cations/contourLev.shtml</a>).</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&#39;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 &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_code.ncl&quot; </div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_csm.ncl&quot; </div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/contributed.ncl&quot; </div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/shea_util.ncl&quot; </div><div>;*****************************<wbr>******************* </div><div>begin </div><div>;*****************************<wbr>******************* </div><div>; read in netCDF files</div><div>;*****************************<wbr>******************* </div><div>a = addfile(&quot;<a href="http://SLP.mon.mean.nc" target="_blank">SLP.mon.mean.nc</a>&quot;,&quot;r&quot;) ; 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-&gt;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-&gt;g0_lat_1</div><div>g0_lon_2 = a-&gt;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&amp;g0_lon_2 = g0_lon_2</div><div>printVarSummary(g0_lon_2)</div><div><br></div><div>slp&amp;g0_lon_2 = g0_lon_2 ; replace with &#39;correct&#39; ordering</div><div>slp&amp;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, &quot;DJF&quot;)</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,3<wbr>7,41,47/),:,:)</div><div>slpDJF_lon_lo = slpDJF((/5,6,22,27,29,33,34,38<wbr>,45,48/),:,:)</div><div><br></div><div>slpAvgTime_hi = dim_avg_n_Wrap(slpDJF_lon_hi,0<wbr>)</div><div>slpAvgTime_lo = dim_avg_n_Wrap(slpDJF_lon_lo,0<wbr>)</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(&quot;ps&quot;,&quot;Panel_lon_S<wbr>LP&quot;) <span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                </span>; open a ps file </div><div>gsn_define_colormap(wks,&quot;temp1<wbr>&quot;)</div><div><br></div><div>plot = new(3,graphic)<span class="m_-7959927968114249044m_-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_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                        </span>= True</div><div>res@gsnDraw<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                </span>= False <span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                </span>; dont draw</div><div>res@gsnFrame<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                </span>= False<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                        </span>; dont advance frame</div><div>res@cnInfoLabelOn<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>= False<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                        </span>; trn off cn info label</div><div>res@gsnAddCyclic = False<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                </span>; has to do with wrapping the lonitude at 0/360</div><div>res@cnFillPalette = &quot;matlab_jet&quot;</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_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>;maximum latitude </div><div>res@mpMinLatF = 25 <span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>;minimum latitude </div><div>res@mpMaxLonF = 30<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>; max lon</div><div>res@mpMinLonF = -110<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>; min lon</div><div>res@mpOutlineBoundarySets = &quot;National&quot;</div><div>res@mpOutlineOn = True<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>; turn map outline on</div><div>res@mpOutlineDrawOrder = &quot;PostDraw&quot;</div><div>res@mpFillOn = False<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>; turn map fill off</div><div>res@cnFillOn = True<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>; turn on color fill</div><div>res@cnLinesOn = False<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                </span>; turn off contour lines</div><div>res@lbOrientation = &quot;Vertical&quot;<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                        </span>; make labels vertical</div><div>res@cnFillPalette = &quot;BlWhRe&quot;</div><div>res@cnLevelSelectionMode = &quot;ManualLevels&quot;<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>; set manual contour levels</div><div>res@cnMinLevelValF = 100000<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                        </span>; set min contour level</div><div>res@cnMaxLevelValF = 102400<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                        </span>; set max countrou level</div><div>res@cnLevelSpacingF = 400<span class="m_-7959927968114249044m_-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,slpAvg<wbr>Time_hi,res)</div><div>plot(1) = gsn_csm_contour_map(wks,slpAvg<wbr>Time_lo,res)</div><div><br></div><div>delete(res@cnLevelSpacingF)<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                        </span>; delete resources before reseting</div><div>res@cnLevelSelectionMode = &quot;ExplicitLevels&quot; ;<span class="m_-7959927968114249044m_-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_s<wbr>lp,res)</div><div><br></div><div><br></div><div>;*****************************<wbr>*******************</div><div>; create panel</div><div>;*****************************<wbr>*******************</div><div>resP = False<span class="m_-7959927968114249044m_-1695601177563552144gmail-Apple-tab-span" style="white-space:pre-wrap">                                        </span>; modify the panel plot</div><div>resP@txString = &quot;lon - SLP&quot;</div><div>gsn_panel(wks,(/plot/),(/3,1/)<wbr>,resP)<span class="m_-7959927968114249044m_-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></div></div><span class="">______________________________<wbr>_________________<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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></span></blockquote></div><br></div>
</blockquote></div><br></div>