<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Number of bins for histogram in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443892#M15268</link>
    <description>&lt;A href="https://blogs.sas.com/content/iml/2014/08/25/bins-for-histograms.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2014/08/25/bins-for-histograms.html&lt;/A&gt;</description>
    <pubDate>Thu, 08 Mar 2018 20:50:34 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-03-08T20:50:34Z</dc:date>
    <item>
      <title>Number of bins for histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443872#M15262</link>
      <description>&lt;P&gt;The option for changing the number of bins for a histogram in SAS University Edition does not work correctly. I tried to specify 20 bins, but the graphs only had 11 bins. What am I missing?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 19:51:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443872#M15262</guid>
      <dc:creator>WilliamBoecklen</dc:creator>
      <dc:date>2018-03-08T19:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Number of bins for histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443883#M15265</link>
      <description>For us to tell what’s missing we need to see what you have. Please post your code and log.&lt;BR /&gt;&lt;BR /&gt;For example, are you using PROC UNIVARIATE or SGPLOT or a different one?</description>
      <pubDate>Thu, 08 Mar 2018 20:22:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443883#M15265</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-08T20:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Number of bins for histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443889#M15266</link>
      <description>&lt;P&gt;I am using SAS University Edition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The code is:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt;&amp;nbsp;*&lt;/P&gt;&lt;P&gt;&amp;nbsp;* Task code generated by SAS Studio 3.71&lt;/P&gt;&lt;P&gt;&amp;nbsp;*&lt;/P&gt;&lt;P&gt;&amp;nbsp;* Generated on '3/8/18, 1:27 PM'&lt;/P&gt;&lt;P&gt;&amp;nbsp;* Generated by 'sasdemo'&lt;/P&gt;&lt;P&gt;&amp;nbsp;* Generated on server 'LOCALHOST'&lt;/P&gt;&lt;P&gt;&amp;nbsp;* Generated on SAS platform 'Linux LIN X64 2.6.32-696.20.1.el6.x86_64'&lt;/P&gt;&lt;P&gt;&amp;nbsp;* Generated on SAS version '9.04.01M5P09132017'&lt;/P&gt;&lt;P&gt;&amp;nbsp;* Generated on browser 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0'&lt;/P&gt;&lt;P&gt;&amp;nbsp;* Generated on web client 'http://localhost:10080/SASStudio/371/main?locale=en_US&amp;amp;zone=GMT-07%253A00&amp;amp;http%3A%2F%2Flocalhost%3A10080%2FSASStudio%2F371%2F='&lt;/P&gt;&lt;P&gt;&amp;nbsp;*&lt;/P&gt;&lt;P&gt;&amp;nbsp;*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods graphics / reset width=6.4in height=4.8in imagemap;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=WORK.DATA1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; histogram x1 / nbins=20;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yaxis grid;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods graphics / reset;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The log is: &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: ODS statements in the SAS Studio environment may disable some output features.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;73&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;74 /*&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;75 *&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;76 * Task code generated by SAS Studio 3.71&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;77 *&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;78 * Generated on '3/8/18, 1:27 PM'&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;79 * Generated by 'sasdemo'&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;80 * Generated on server 'LOCALHOST'&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;81 * Generated on SAS platform 'Linux LIN X64 2.6.32-696.20.1.el6.x86_64'&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;82 * Generated on SAS version '9.04.01M5P09132017'&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;83 * Generated on browser 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0'&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;84 * Generated on web client&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;84 ! 'http://localhost:10080/SASStudio/371/main?locale=en_US&amp;amp;zone=GMT-07%253A00&amp;amp;http%3A%2F%2Flocalhost%3A10080%2FSASStudio%2F3&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;84 ! 71%2F='&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;85 *&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;86 */&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;87&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;88 ods graphics / reset width=6.4in height=4.8in imagemap;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;89&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;90 proc sgplot data=WORK.DATA1;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;91 histogram x1 / nbins=20;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;92 yaxis grid;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;93 run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROCEDURE SGPLOT used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 4.79 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.21 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The font &amp;lt;sans-serif&amp;gt; is not available. Albany AMT will be used.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The font &amp;lt;sans-serif&amp;gt; is not available. Albany AMT will be used.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 500 observations read from the data set WORK.DATA1.&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;94&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;95 ods graphics / reset;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;96&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;97 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;110&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&lt;STRONG&gt;The result is a histogram with 11 bars&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 08 Mar 2018 20:43:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443889#M15266</guid>
      <dc:creator>WilliamBoecklen</dc:creator>
      <dc:date>2018-03-08T20:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Number of bins for histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443891#M15267</link>
      <description>&lt;P&gt;I think there's more bins they're just really really small.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'll get better control if you control the start and end instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's also a note in the documentation about how it's not always what you expect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;H4 class="xis-argument"&gt;NBINS=&lt;SPAN class="xis-userSuppliedValue"&gt;numeric-value&lt;/SPAN&gt;&lt;/H4&gt;
&lt;/BLOCKQUOTE&gt;
&lt;DIV class="xis-argumentDescription"&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN class="xis-shortDescription"&gt;specifies the number of bins.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="xis-paraSimpleFirst"&gt;The system determines the BINWIDTH= value. The bins always span the range of the data.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="xis-paraSimple"&gt;The procedure attempts to produce tick values that are easily interpreted (for example, 5, 10, 15, 20). &lt;FONT color="#FF6600"&gt;T&lt;STRONG&gt;he procedure sometimes adjusts the location of the first bin and the bin width accordingly. As a result, the number of bins shown in the plot might not exactly match the number specified with NBINS=.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can see the exact data used, with the data set below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output sgplot=myBins;
proc sgplot data=sashelp.cars ;
histogram mpg_highway / nbins=20;
run;

proc print data=myBins;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Mar 2018 20:50:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443891#M15267</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-08T20:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Number of bins for histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443892#M15268</link>
      <description>&lt;A href="https://blogs.sas.com/content/iml/2014/08/25/bins-for-histograms.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2014/08/25/bins-for-histograms.html&lt;/A&gt;</description>
      <pubDate>Thu, 08 Mar 2018 20:50:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443892#M15268</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-08T20:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: Number of bins for histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443902#M15269</link>
      <description>&lt;P&gt;I specified the max and min values for the data. The data are 500 uniform random (-1,1) deviates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result is the same - 11 bars.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The code is:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods graphics / reset width=6.4in height=4.8in imagemap;&lt;BR /&gt;&lt;BR /&gt;proc sgplot data=WORK.DATA1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;histogram x1 / nbins=20;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;xaxis min=-1 max=1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;yaxis grid;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;ods graphics / reset;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 21:16:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443902#M15269</guid>
      <dc:creator>WilliamBoecklen</dc:creator>
      <dc:date>2018-03-08T21:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Number of bins for histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443917#M15270</link>
      <description>&lt;P&gt;This works for me:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.cars ;
histogram mpg_highway / binstart=10 binwidth=10 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Mar 2018 22:03:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443917#M15270</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-08T22:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Number of bins for histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443923#M15271</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/188910"&gt;@WilliamBoecklen&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I specified the max and min values for the data. The data are 500 uniform random (-1,1) deviates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result is the same - 11 bars.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The code is:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods graphics / reset width=6.4in height=4.8in imagemap;&lt;BR /&gt;&lt;BR /&gt;proc sgplot data=WORK.DATA1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;histogram x1 / nbins=20;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;xaxis min=-1 max=1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;yaxis grid;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;ods graphics / reset;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Xaxis really doesn't have much to do with the bin assignments. It may cutoff bins or create a lot of unused axis in relation to the shown bins and will effect the displayed width of the bins thereby.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 22:18:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443923#M15271</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-08T22:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Number of bins for histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443941#M15272</link>
      <description>Thank for the response. I am teaching a biometry course and I chose SAS Studio to avoid programing. I wanted the students to have a point and click interface. Unfortunately the point and click options do not work.</description>
      <pubDate>Fri, 09 Mar 2018 00:14:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443941#M15272</guid>
      <dc:creator>WilliamBoecklen</dc:creator>
      <dc:date>2018-03-09T00:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: Number of bins for histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443953#M15273</link>
      <description>&lt;P&gt;Does your log say anything about the NBINS not being honored?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 02:09:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Number-of-bins-for-histogram/m-p/443953#M15273</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2018-03-09T02:09:54Z</dc:date>
    </item>
  </channel>
</rss>

