<div dir="ltr"><div class="gmail_default" style="font-size:small">Zhen,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Which markers in particular are not showing up? It's too hard for us to look at your output and try to figure out which dots are on the plot and which are not.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Also, it's very unlikely that NCL would just drop some of those dots.  There has to be something else going on, like the dots are out-of-range of the limits of your X and/or Y axes.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">[1] Clean coding tip: you do not need to loop across each index of the array to add each dot, if you are drawing them all with the same color and size. Instead of this code:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace">dot=new((/dimsizes(forc),dimsizes(lat)*dimsizes(plev)/),graphic)</font></div><div class="gmail_default"><font face="monospace, monospace">do iex=0,dimsizes(forc)-1</font></div><div class="gmail_default"><font face="monospace, monospace"> . . .</font></div></div><div class="gmail_default"><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">  do ip=0,npts-1</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">    dot(iex,ip) = gsn_add_polymarker(wks,plot(iex),lat(indices(ip,1)),plev(indices(ip,0)),resmarker)</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">  end do</font></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">you can have this code:</div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">dot=new((/dimsizes(forc),dimsizes(lat)/),graphic)</font></div><div class="gmail_default"><font face="monospace, monospace">do iex=0,dimsizes(forc)-1</font></div><div class="gmail_default"><font face="monospace, monospace"> . . .</font></div><div class="gmail_default"><font face="monospace, monospace">  dot(iex) = gsn_add_polymarker(wks,plot(iex),lat(indices(:,1)),plev(indices(:,0)),resmarker)<br></font></div><div class="gmail_default"><br></div><div class="gmail_default">This will run faster, because each call to gsn_add_polymarker causes the creation of an internal object, and if you do this for each single dot, you are going to end up using more memory and taking more time.</div><div class="gmail_default"><br></div><div class="gmail_default">[2] Clean coding tip: if you find yourself calling "dimsizes" on the same variable multiple times, I suggest saving it to a variable so it can save you some typing:</div><div class="gmail_default"><br></div><div class="gmail_default">For example:</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default">var_run = new((/dimsizes(forc),dimsizes(ens),dimsizes(year),23,90/),"float")</div><div class="gmail_default">var_djf_clim =  new((/dimsizes(forc),dimsizes(ens),23,90/),"float") ; 10 years                             </div><div class="gmail_default">rc_m = new((/dimsizes(forc),23,90/),"float")</div><div class="gmail_default">do iv=0,dimsizes(vars)-1</div><div class="gmail_default"><br></div><div class="gmail_default">could be changed to:</div><div class="gmail_default"><br></div><div class="gmail_default"><font face="monospace, monospace">nforc = dimsizes(forc)</font></div><div class="gmail_default"><font face="monospace, monospace">nens  = dimsizes(ens)</font></div><div class="gmail_default"><font face="monospace, monospace">nyear = dimsizes(year)</font></div><div class="gmail_default"><font face="monospace, monospace">nvars = dimsizes(vars)</font></div><div class="gmail_default">







<p class="gmail-p1"><font face="monospace, monospace"><span class="gmail-s1">var_run = </span><span class="gmail-s2">new</span><span class="gmail-s1">(</span><span class="gmail-s2">(/n</span><span class="gmail-s1">forc,n</span><span class="gmail-s1">ens,n</span><span class="gmail-s1">year),23,90</span><span class="gmail-s2">/)</span><span class="gmail-s1">,</span><span class="gmail-s4">"float"</span><span class="gmail-s1">)<br></span></font><span class="gmail-s5" style="font-family:monospace,monospace">var_djf_clim =<span class="gmail-Apple-converted-space">  </span></span><span class="gmail-s2" style="font-family:monospace,monospace">new</span><span class="gmail-s5" style="font-family:monospace,monospace">(</span><span class="gmail-s2" style="font-family:monospace,monospace">(/n</span><span class="gmail-s5" style="font-family:monospace,monospace">forc,n</span><span class="gmail-s5" style="font-family:monospace,monospace">ens),23,90</span><span class="gmail-s2" style="font-family:monospace,monospace">/)</span><span class="gmail-s5" style="font-family:monospace,monospace">,</span><span class="gmail-s4" style="font-family:monospace,monospace">"float"</span><span class="gmail-s5" style="font-family:monospace,monospace">) </span><span class="gmail-s1" style="font-family:monospace,monospace">; 10 years<span class="gmail-Apple-converted-space">                             <br></span></span><span class="gmail-s1" style="font-family:monospace,monospace">rc_m = </span><span class="gmail-s2" style="font-family:monospace,monospace">new</span><span class="gmail-s1" style="font-family:monospace,monospace">(</span><span class="gmail-s2" style="font-family:monospace,monospace">(/n</span><span class="gmail-s1" style="font-family:monospace,monospace">forc,23,90</span><span class="gmail-s2" style="font-family:monospace,monospace">/)</span><span class="gmail-s1" style="font-family:monospace,monospace">,</span><span class="gmail-s4" style="font-family:monospace,monospace">"float"</span><span class="gmail-s1" style="font-family:monospace,monospace">)<br></span><span class="gmail-s2" style="font-family:monospace,monospace">do</span><span class="gmail-s1" style="font-family:monospace,monospace"> iv=0,nvars-1</span></p><p class="gmail-p1"><span class="gmail-s1">I don't know what "23" and "90" are supposed to represent, but it would be good to also assign these to variables as well, so if you need to change the 23 or 90 values later, you can just do it in one place.</span></p><p class="gmail-p1"><span class="gmail-s1">[3] Clean coding tip: you don't need to use "new" to preallocate an array that is getting calculated by a function.  You have this code:</span></p><p class="gmail-p1"><font face="monospace, monospace"><span class="gmail-s1">rc_m = </span><span class="gmail-s2">new</span><span class="gmail-s1">(</span><span class="gmail-s2">(/</span><span class="gmail-s3">dimsizes</span><span class="gmail-s1">(forc),23,90</span><span class="gmail-s2">/)</span><span class="gmail-s1">,</span><span class="gmail-s4">"float"</span><span class="gmail-s1">)<br></span><span class="gmail-s1">rc_m = </span><span class="gmail-s2">regCoef_n</span><span class="gmail-s1">(year,var_ens,0,1)</span></font></p><p class="gmail-p1">Remove the "new" line as it is not needed.  The regCoef_n function will allocate the memory for you, as does every single NCL function.</p><p class="gmail-p1">If you continue to have problems with the dots, please be more specific about which dots are not showing up.</p><p class="gmail-p1">--Mary</p><p class="gmail-p1"><br></p><p class="gmail-p1"><span class="gmail-s1"><br></span></p></div></div><div class="gmail_default"><br></div><div class="gmail_default"><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 9, 2017 at 2:56 PM, 刘振 <span dir="ltr"><<a href="mailto:286909655@qq.com" target="_blank">286909655@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:"lucida Grande",Verdana">Dear all,</div><div style="font-family:"lucida Grande",Verdana"><br></div><div style="font-family:"lucida Grande",Verdana">  I am using ncl 6.4 to plot and want to print dot when value pass student t test using function gsn_add_polymaker (script and figure attached, i.e. 850hPa). But the dots are only printed at some levels (not all levels) in vertical direction. Actually, I got 23 pressure levels for my data and indeed some dot are not printed on the plot when I print the indices passing significance level (see log files attached). Could you please help me to solve this problem. Thanks.</div></div><div style="font-family:"lucida Grande",Verdana"><br></div><div style="font-family:"lucida Grande",Verdana">zhen</div><div><br></div><div><div style="color:#909090;font-family:Arial Narrow;font-size:12px">------------------</div><div style="font-size:14px;font-family:Verdana;color:#000"><div>刘振</div>
<div>中山大学<br>环境科学与工程学院<br>大气科学系<br>Phone: <a href="tel:+86%20150%201324%206049" value="+8615013246049" target="_blank">+86-15013246049</a></div>
<div>Liu  Zhen</div>
<div>Department of Atmospheric Science<br>School of Environmental Science and Engineering</div>
<div>Sun Yat-sen University<br>Email address: <font color="#7f7f7f"><a href="mailto:liuzhen9@mail2.sysu.edu.cn" target="_blank">liuzhen9@mail2.sysu.edu.cn</a></font> </div></div></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>