<div dir="ltr">That is one fancy bit of programming...<div><br></div><div>Thank you -- wonderful.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 25, 2017 at 9:09 PM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.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"><div><div><div><div><div><div>Re: <span style="background-color:rgb(255,231,198);color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:13.3333px">Compares two arrays. Both arrays are combined into a single array with the first dimension equal to 2<br><br></span>Let x and y be 1D but of different lengths:<br><br></div> nx = dimsizes(x)<br></div> ny = dimsizes(y)<br></div> lxy = max( (/ nx,ny /) )<br><br></div> xy = new( (/2,lxy/), typeof(x), getVarFillValue(x))<br><br></div> xy(0,0:nx-1) = (/ x /) ; (/... /) no meta data<br> xy(1,0:ny-1) = (/ y /) <br><br></div>HTH<br><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 25, 2017 at 11:14 AM, Barry Lynn <span dir="ltr"><<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@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 have been using example 6.</div><div><br></div><div>However, the page says: "<span style="background-color:rgb(255,231,198);color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:13.3333px">Compares two arrays. Both arrays are combined into a single array with the first dimension equal to 2," </span></div><div><span style="background-color:rgb(255,231,198);color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:13.3333px"><br></span></div><div>and implies that both arrays are of the same length.</div><div><br></div><div>In my case, they are of different lengths.</div><div><br></div><div>Regarding the bar graphs -- I didn't see this particular page when I first looked for bar graphs. However, it won't be helpful if I can't put one behind the other (and slightly off to the side) like you can with <span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0);font-family:"courier new";font-size:16px">res@gsnHistogramCompare</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0);font-family:"courier new";font-size:16px"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0);font-family:"courier new";font-size:16px">= True</span></div><span class="m_1676487690104589801HOEnZb"><font color="#888888">
<div><br></div><div>Barry</div></font></span></div><div class="m_1676487690104589801HOEnZb"><div class="m_1676487690104589801h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 25, 2017 at 7:06 PM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.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"><div class="gmail_default" style="font-size:small">Hi Barry,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Those numbers at the top are coming from this line, which sets the main title for your plot:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"> res@tiMainString = str_join(""+x,",")</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Remove or comment this line.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">In what way do you want to combine the two graphs? Do you want the bars side-by-side, or stacked?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">As an example, visit this page:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/bar.shtml" target="_blank">http://www.ncl.ucar.edu/Applic<wbr>ations/bar.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">and look at:</div><div class="gmail_default"><br></div><div class="gmail_default">unique_5.ncl</div><div class="gmail_default">bar_10.ncl</div><div class="gmail_default">bar_15.ncl</div><div class="gmail_default"><br></div><div class="gmail_default">etc</div><div class="gmail_default"><br></div><div class="gmail_default">You can also look at the histogram page, see histo_6.ncl:</div><div class="gmail_default"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/histo.shtml#ex6" target="_blank">http://www.ncl.ucar.edu/Applic<wbr>ations/histo.shtml#ex6</a><span class="m_1676487690104589801m_-3892557373307951178HOEnZb"><font color="#888888"><br></font></span></div><span class="m_1676487690104589801m_-3892557373307951178HOEnZb"><font color="#888888"><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div></font></span></div><div class="m_1676487690104589801m_-3892557373307951178HOEnZb"><div class="m_1676487690104589801m_-3892557373307951178h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 25, 2017 at 9:46 AM, Barry Lynn <span dir="ltr"><<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@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 followed Mary's comments to imply that the histogram function plots the number of elements within each interval. Hence, when my obs distribution show, for example 227, I created 227 consecutive elements with the value 0, and then proceeded through the distribution.</div><div><br></div><div>I would like to do the following:</div><div><br></div><div>1) remove the list of numbers at the top of each graph,</div><div><br></div><div>2) Combine the graphs.</div><div><br></div><div>The typical approach doesn't work (bottom of code) because there are different numbers of x and y.</div><span><div><br></div><div>Thank you for your suggestions.</div><div><br></div><div>Barry</div></span><div>P.S. The code runs stand alone.</div></div><div class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751HOEnZb"><div class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 25, 2017 at 12:34 AM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.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"><div class="gmail_default" style="font-size:small">Hi Barry,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The gsn_histogram function takes whatever "bin" values you give it, and counts the number of values that fall in each bin, and then draws this as a bar.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you don't provide any bins, then gsn_histogram will pick "nice" bins for you.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The binning happens such that no values are binned in more than one interval.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Try running the attached script. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">In the first plot, I let gsn_histogram pick the bin intervals.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The first bin, which is from 1 to 2, will capture all values >= 1 and < 2, the second bin counts all values >=2 and < 3 and so on. The very last bin, 9 to 10, will count all values >= 9 and <= 10.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The second plot I specifically set the bin intervals that I want.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">In the third plot, instead of counting values that fall in a range, I set an array of discrete values to explicitly count.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Hope this helps clear things up.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461h5">On Sun, Apr 23, 2017 at 2:23 AM, Barry Lynn <span dir="ltr"><<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461h5"><div dir="ltr">Hi:<div><br></div><div>I have data specified as below.</div><div><br></div><div>I adapted code from this page:</div><div><br></div><div><a href="https://www.ncl.ucar.edu/Applications/histo.shtml" target="_blank">https://www.ncl.ucar.edu/Appli<wbr>cations/histo.shtml</a><br></div><div><br></div><div>Example # 6.</div><div><br></div><div>I set x = "Obs" and y = "Forecast" below.</div><div><br></div><div>The plot I get spreads the obs and forecast data on the x axis (where the x axis conforms to the value of each).</div><div><br></div><div>The y axis is labeled "Frequency."</div><div><br></div><div>However, this is not a histogram/bar graph I am familiar with. I am not sure how frequency is calculated (perhaps out of the total). In any case, I want to plot the x axis as intervals of 0 to 100 (by 10). I want the y-axis to show the values in the obs/forecasts that conform to these intervals. (Kaleidagraph can do this easily, but that's not the point (obviously)).</div><div><br></div><div>I see no such example of how to do this -- even though this is often how bar graphs are presented.</div><div><br></div><div>Thank you for your suggestions.</div><div><br></div><div>Barry</div><div><br></div><div><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"> z = new((/2,dimsizes(x)/),integer)
z(0,:) = x
z(1,:) = y</pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"><p class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-p1"><span class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-s1">Percent, Obs, Forecast</span></p>
<p class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-p1"><span class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-s1"> 0 0.0, 0.0,</span></p>
<p class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-p1"><span class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-s1"> 1 227.0, 212.2,</span></p>
<p class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-p1"><span class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-s1"> 4 375.0, 176.7,</span></p>
<p class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-p1"><span class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-s1"> 8 201.0, 141.1,</span></p>
<p class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-p1"><span class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-s1"> 12 62.0, 143.2,</span></p>
<p class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-p1"><span class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-s1"> 18 26.0, 327.5,</span></p>
<p class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-p1"><span class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-s1"> 24 6.0, 199.5,</span></p>
<p class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-p1"><span class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-s1"> 30 1.0, 50.2,</span></p>
<p class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-p1"><span class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-s1"> 36 2.0, 9.4,</span></p>
<p class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-p1"><span class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail-s1"> 100 0.0, 4.0,</span></p>
</pre></div><div><br></div><div><br></div><div><br clear="all"><div><br></div>-- <br><div class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461m_-4050567108541330383m_2869134393032695916gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US <a href="tel:(914)%20432-3108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></div>
</div></div>
<br></div></div>______________________________<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></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_1676487690104589801m_-3892557373307951178m_-169559304925986751m_86495873125316461gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US <a href="tel:(914)%20432-3108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></div>
</div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_1676487690104589801m_-3892557373307951178gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US <a href="tel:(914)%20432-3108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></div>
</div>
</div></div><br>______________________________<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></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US 914 432 3108<br></div></div></div>
</div>