<div dir="ltr"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear Sir Dennis,</div><div dir="ltr"><br></div><div dir="ltr">Thank you so much!!</div><div>This is what I'm looking for.</div><div dir="ltr"><br></div><div dir="ltr">Sincerely,</div><div dir="ltr"><br></div><div dir="ltr">Lyndz<br><div><br></div></div></div></div></div></div></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 16, 2019 at 11:15 PM Dennis Shea <<a href="mailto:shea@ucar.edu">shea@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>You can count yourself:</div><div><br></div><div>  nRain0    = <b>num</b>(rain_region.eq.0)<br>  nRain     = num(rain_region.gt.0)<br>  nRainMsg  = num(ismissing(rain_region))<br><br>  print("  nRain0="+nRain0)<br>  print("  nRain ="+nRain )<br>  print("nRainMsg="+nRainMsg)</div><div><br></div><div>  opt = True<br>  opt@PrintStat = True<br>  stat_rain_region = <b>stat_dispersion</b>(rain_region, opt )<br>print("===")<br><br>  n_1015 = num(rain_region.ge.10 .and. rain_region.lt.15)<br>  print("n_1015="+n_1015)<br>print("===")<br><br>  test   = <b>ndtooned</b>(rain_region)<br>  iGood  = <b>ind</b>(test.gt.0)         ; only grid points > 0.0<br>  test  <b>:=</b> test(iGood)<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 14, 2019 at 2:51 AM Lyndz via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr" class="gmail-m_-6235055226655586199gmail-m_3096971731177391944gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dear NCL experts,</div><div><font size="4"><br></font></div><div><b><font size="4">[Details]</font></b></div><div>I  want to plot a histogram with the number of grid points in the y-axis and rainfall classification in the x-axis.</div><div>The attached figure is an example of what I wanted (Desired_output.gif).</div><div><br></div><div>The data that I am using can be downloaded from this link:</div><div><a href="https://www.dropbox.com/s/lbkjlqgq9era5c7/APHRO_AMJ_1979-2015.nc?dl=0" target="_blank">https://www.dropbox.com/s/lbkjlqgq9era5c7/APHRO_AMJ_1979-2015.nc?dl=0</a><br></div><div><br></div><div><b><font size="4">[What I have so far]</font></b></div><div>The following is the script that I am using:</div><div><br></div><div>;***********************************************************<br>;This script creates a histogram of the number of gridpoints<br>;with rainfall above 0 mm/day<br>;Created by Lyndz<br>;<a href="mailto:olagueralyndonmark429@gmail.com" target="_blank">olagueralyndonmark429@gmail.com</a><br>;*******************************************************</div><div>begin</div><div>fo = addfile("APHRO_AMJ_1979-2015.nc","r")<br>rain=fo->precip(:,:,:)<br>rain_region=rain(:,{12.5:22},{120:122.5})<br><b>test=ndtooned(rain_region)</b><br>;*************************************<br>;Plots histogram<br>;*************************************<br>  wks = gsn_open_wks("png","output")             ; send graphics to PNG file<br>  gsn_define_colormap(wks,"temp1")              ; choose colormap<br>  res                                 = True<br>  res@gsnHistogramSelectNiceIntervals = False   ; intervals now float<br>  res@gsnHistogramComputePercentages  = True    ; change left axis to %<br>  res@gsnHistogramClassIntervals = (/0,1,5,10,15,20,25,30,25,40,45/)<br>  res@gsnHistogramComputePercentagesNoMissing = True<br>  res@tmXBPrecision = 2         ; set the precision to 2 significant digits<br>  res@tmYLFormat = "#^se"       ; don't use "e" symbol, always show +/-<br>  res@tiXAxisString   = "Rainfall[mm/day]"<br>  res@tiYAxisString   = "Number of Grid Points"<br>  plot=gsn_histogram(wks,test,res)                 ; create histogram with 10 bins<br>end<br></div><div><br></div><div><b><font size="4">[Issues/Problems]</font></b></div><div>[1] The script runs fine. The output is attached (output.png). I am not sure if  I plotted this correctly. After using ndtooned, I just plotted the histogram. Is there a way to check if the y-axis is really the number of gridpoints or the x axis is the rainfall class?</div><div>Or is there a way to invoke that the y-axis is the number of gridpoints when plotting the histogram?</div><div><br></div><div>I'll appreciate any help with this.</div><div><br></div><div>Sincerely,</div><div>Lyndz</div><div><br></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></blockquote></div>
</blockquote></div>