<?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: Change barwidth sgplot histogram in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736984#M21436</link>
    <description>&lt;P&gt;what does this nbins really do? I just wanted to reduce the size of the bars like when using barwidth=0.9 or barwidth=0.6&lt;/P&gt;</description>
    <pubDate>Mon, 26 Apr 2021 13:24:23 GMT</pubDate>
    <dc:creator>Anita_n</dc:creator>
    <dc:date>2021-04-26T13:24:23Z</dc:date>
    <item>
      <title>Change barwidth sgplot histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736937#M21428</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;is there any way to change the barwidth&lt;/P&gt;
&lt;P&gt;in sgplot histogram statement?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 10:50:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736937#M21428</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2021-04-26T10:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: Change barwidth sgplot histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736938#M21429</link>
      <description>&lt;P&gt;use the BINWIDTH= option&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/n17xrpcduau1f8n1c1nhe477pv18.htm#p10yvray7y3xs8n1go4hfvht8fzj" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/n17xrpcduau1f8n1c1nhe477pv18.htm#p10yvray7y3xs8n1go4hfvht8fzj&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 11:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736938#M21429</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-04-26T11:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Change barwidth sgplot histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736945#M21430</link>
      <description>&lt;P&gt;Hi thanks, is binwidth=barwidth. This is not giving me the right results, even if I use even when I use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;binwidth= binstart=&amp;nbsp; showbins&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 11:36:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736945#M21430</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2021-04-26T11:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Change barwidth sgplot histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736947#M21431</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/168930"&gt;@Anita_n&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi thanks, is binwidth=barwidth. This is not giving me the right results, even if I use even when I use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;binwidth= binstart=&amp;nbsp; showbins&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Explain further. What is not giving you the right results? What isn't right about them? Show us your code. Show us your output.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 11:41:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736947#M21431</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-04-26T11:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Change barwidth sgplot histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736950#M21432</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sgplot data=sashelp.heart;
where sex=:'F';
histogram agechddiag / fillattrs=(color=pink);
run;

/*After adding binwidth*/
proc sgplot data=sashelp.heart;
where sex=:'F';
histogram agechddiag / fillattrs=(color=pink) binwidth=5 binstart=50 showbins;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Apr 2021 12:02:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736950#M21432</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2021-04-26T12:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Change barwidth sgplot histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736951#M21433</link>
      <description>&lt;P&gt;Please explain what is wrong with the plot, and what you would like to see.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 12:05:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736951#M21433</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-04-26T12:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Change barwidth sgplot histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736963#M21434</link>
      <description>&lt;PRE&gt;ods select histogram;
proc univariate data=sashelp.heart ;
where sex=:'F';
var agechddiag ;
histogram agechddiag / kernel  barwidth=1; 
run;

proc univariate data=sashelp.heart ;
where sex=:'F';
var agechddiag ;
histogram agechddiag / kernel  endpoints=(30 to 100 by 20)  ;
run;

&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Apr 2021 12:19:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736963#M21434</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-04-26T12:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: Change barwidth sgplot histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736965#M21435</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

proc sgplot data=sashelp.heart;
where sex=:'F';
histogram agechddiag / fillattrs=(color=pink) nbins=10  showbins;
run;

proc sgplot data=sashelp.heart;
where sex=:'F';
histogram agechddiag / fillattrs=(color=pink) nbins=5  showbins;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Apr 2021 12:24:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736965#M21435</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-04-26T12:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Change barwidth sgplot histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736984#M21436</link>
      <description>&lt;P&gt;what does this nbins really do? I just wanted to reduce the size of the bars like when using barwidth=0.9 or barwidth=0.6&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 13:24:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736984#M21436</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2021-04-26T13:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Change barwidth sgplot histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736990#M21437</link>
      <description>&lt;P&gt;In a histogram, the bar width is data-driven. The width of the bar shows the range of values included in the bin. By changing the number of bins (NBINS), you change the range of values in each bin. The more bins you have, the thinner the bars will be.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 13:36:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/736990#M21437</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2021-04-26T13:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Change barwidth sgplot histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/737010#M21440</link>
      <description>&lt;P&gt;Okay , thanks I now understand how it works&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 15:06:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/737010#M21440</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2021-04-26T15:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Change barwidth sgplot histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/737636#M21461</link>
      <description>&lt;P&gt;If I understand your question, you want to control the physical width of the bars (not the 'width' of the data bin - ie, not the range of values in each bar) ? ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In sgplot histograms, I believe the physical width of the bars expands to fill most/all available space. Therefore one way to control the physical width of the bars would be to change the width of the page. (But you probably don't want that.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also add more 'offset' between the bars and the axes, using the &lt;STRONG&gt;xaxis offsetmin=&lt;/STRONG&gt; and &lt;STRONG&gt;offsetmax=&lt;/STRONG&gt; options, to 'squeeze' the bars into a smaller space and make them 'skinnier' (offsetmin controls the space on the left side, and offsetmax controls the right side). Here's an example, without and with the offsetmin and offsetmax options:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* default, with no offsetmin/offsetmax specified */&lt;/P&gt;
&lt;P&gt;proc sgplot data=sashelp.heart;&lt;BR /&gt;where sex=:'F';&lt;BR /&gt;histogram agechddiag / nbins=7 fillattrs=(color=pink);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="histogram_default.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58784i5FAE0B9454D184A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="histogram_default.png" alt="histogram_default.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data=sashelp.heart;&lt;BR /&gt;where sex=:'F';&lt;BR /&gt;histogram agechddiag / nbins=7 fillattrs=(color=pink);&lt;BR /&gt;xaxis &lt;STRONG&gt;offsetmin=.2 offsetmax=.2&lt;/STRONG&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="histogram_offset.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58785iC5E793419D4E8C91/image-size/large?v=v2&amp;amp;px=999" role="button" title="histogram_offset.png" alt="histogram_offset.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 16:34:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/737636#M21461</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2021-04-28T16:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Change barwidth sgplot histogram</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/737823#M21462</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13585"&gt;@GraphGuy&lt;/a&gt;&amp;nbsp;yes, that is exactly what I wanted. Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 08:00:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Change-barwidth-sgplot-histogram/m-p/737823#M21462</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2021-04-29T08:00:22Z</dc:date>
    </item>
  </channel>
</rss>

