<div dir="ltr"><div class="gmail_default" style="font-size:small">Dear Noelia,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">When you are paneling a series of color contour plots and then paneling them later, you first want to be sure you use a fixed set of contour levels across all the plots, so you can then use a single labelbar in the final panel plot.</div><div class="gmail_default" style="font-size:small"><br></div>The function nice_mnmxintvl<div class="gmail_default" style="font-size:small;display:inline"> is what you can use to fix your contour levels</div><div><pre><div class="gmail_default" style="font-size:small;display:inline"> </div>mnmxlvl = nice_mnmxintvl(min(data),max(<wbr>data),16,False)<br>
res@cnLevelSelectionMode = "ManualLevels"
res@cnMinLevelValF = mnmxlvl(0)
res@cnMaxLevelValF = mnmxlvl(1)
res@cnLevelSpacingF = mnmxlvl(2)</pre><pre><font face="arial, helvetica, sans-serif">You will need to get the min and max of your data across all plots, and pass that to<br></font></pre><div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">The "min(data)" and "max(data)" are from another example. You will need to plug in the min/max of your own data across all plots.</font></div></div></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">You now want to turn off the individual labelbar you're getting for each plot:</font></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"> res@lbLabelBarOn = False</font></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">and then turn on the panel labelbar when you call gsn_panel:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">pres = True</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">pres@gsnPanelLabelBar = True</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">...</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">gsn_panel(...)</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">You may want to see our "panel" examples page:</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><a href="http://www.ncl.ucar.edu/Applications/panel.shtml">http://www.ncl.ucar.edu/Applications/panel.shtml</a><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">I think panel_35.ncl uses the nice_mnmxintvl function.</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">--Mary</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 10, 2017 at 11:37 AM, Noelia otero <span dir="ltr"><<a href="mailto:noeli1680@gmail.com" target="_blank">noeli1680@gmail.com</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!<div><br></div><div>I am plotting in a panel plots seasonal means from different models, and I got some "empty" plots for some specific models and seasons. My guess is that it is due to the large spread of values (or some outliers). Maybe, it's a simple question..but I don't know how to set the resources to get a good label bar. I attach the final plot that I got with my code (see a part of the code below):</div><div><br></div><div>; i= model ,s =season</div><div><br></div><div> model = addfile(fils(i), "r")</div><div> c=str_split(fils(i), "/")</div><div> nmod=str_split(c(6), "#")</div><div> mmod=nmod(0)</div><div> print(nmod)</div><div> sfile=systemfunc("ls " + dir2 + mmod +"*"+ season(s)+".nc")</div><div> smodel=addfile(sfile, "r") </div><div><br></div><div> svar = smodel ->$var$</div><div> svar!1="lat"</div><div> svar!2="lon" </div><div><br></div><div><div>;------Getting statistics for each grid point-------</div><div><br></div><div> stats_seas_var = new((/nlat,mlon/), typeof(svar),-9e+33)</div><div> </div><div>;-------get 95th possition 25 of statistics---------</div><div><br></div><div><br></div><div> opt=False</div><div> do nl=0,nlat-1</div><div> do ml=0,mlon-1</div><div> </div><div> seas_st_var = stat_dispersion( svar(:,nl,ml), opt)</div><div> stats_seas_var(nl,ml) = seas_st_var(0)</div><div><br></div><div> ;stat_dispersion: (0) mean, (1) std, (2), min, (14),max</div><div> end do </div><div> end do </div><div><br></div><div> </div><div> stats_seas_var@long_name = "mean"</div><div> stats_seas_var!0="lat"</div><div> stats_seas_var!1="lon"</div><div> stats_seas_var&lat = lat</div><div> stats_seas_var&lon = lon</div><div><br></div><div> res = True</div><div> res@gsnMaximize = True</div><div> res@cnFillOn = True</div><div> res@cnLinesOn = False</div><div> res@gsnAddCyclic = False</div><div> res@gsnDraw = False</div><div> res@gsnFrame = False</div><div> res@mpMinLonF = min(lon)</div><div> res@mpMinLatF = min(lat)</div><div> res@mpMaxLonF = max(lon)</div><div> res@mpMaxLatF = max(lat)</div><div> res@lbLabelAutoStride=True</div><div> res@cnLevelSelectionMode = "ManualLevels"</div><div> res@cnMinLevelValF = 0.</div><div> res@cnMaxLevelValF = 10.</div><div> res@cnLevelSpacingF = 5.</div><div> res@lbLabelBarOn = False</div><div> res@gsnCenterString =nmod(0)</div><div> res@gsnRightString =season(s)</div><div> plotseas = gsn_csm_contour_map(wks,stats_<wbr>seas_var,res)</div></div><div><br></div><div>I really appreciate any suggestion to improve it,</div><div><br></div><div>Many thanks in advance,</div><div><br></div><div>Noelia</div><div><br></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>