<?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 SGPLOT, VBAR, changing width of the bar according to a variable in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-changing-width-of-the-bar-according-to-a-variable/m-p/256063#M9285</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to konw if it is possible to create bar plots (VBARS for example) and set up the width of the bars according to a variable (the relative abundance of each category).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To illustrate my question, here is a&amp;nbsp;plot from this paper (&lt;SPAN&gt;&lt;A href="http://bit.ly/1nC991b)" target="_blank"&gt;http://bit.ly/1nC991b)&lt;/A&gt; &amp;nbsp;(Figure 3b).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It is exactely the type of plot I need to do for a ungoing project!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2284iB3EF96F8F455DAE1/image-size/medium?v=mpbl-1&amp;amp;px=-1" border="0" alt="Capture d’écran 2016-03-11 à 11.45.44.png" title="Capture d’écran 2016-03-11 à 11.45.44.png" /&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="page" title="Page 5"&gt;
&lt;DIV class="layoutArea"&gt;
&lt;DIV class="column"&gt;
&lt;P&gt;&lt;SPAN&gt;"The width of the bars represents relative abundance and the black component indicates the proportion of generalist feeders within the whole community: the higher the bar, the greater the proportion"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Gámez-Virués, S., Perović, D. J., Gossner, M. M., Börschig, C., Blüthgen, N., de Jong, H., ... &amp;amp; Scherber, C. (2015). Landscape simplification filters species traits and drives biotic homogenization. &lt;/SPAN&gt;&lt;I&gt;Nature communications&lt;/I&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;I&gt;6&lt;/I&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is the (simplified) code for the plot I am working on:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Habit is a categorical variable with 2 values.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;size is a categorical variable with 3 values&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;cate_col is a categorical variable with 2 values&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;FreqLFcol_cate is a table obtained with PROC FREQ&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=trait; by habit size;run;&lt;BR /&gt;proc freq data=trait;&lt;BR /&gt;by habit size;&lt;BR /&gt;table cate_flo / out=FreqLFcol_cate ;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sgpanel data=FreqLFcol_cate;&lt;BR /&gt;panelby habit ;&lt;BR /&gt;vbar size / response=Percent group=cate_flo grouporder=data groupdisplay=stack;&lt;BR /&gt;&lt;BR /&gt;rowaxis label = 'Percentage of species ' ;&lt;BR /&gt;colaxis label = 'size ';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;I would to set up the width of the bars according to&amp;nbsp;the relative abundance of species in the "size" variable as done by&amp;nbsp;&lt;SPAN&gt;Gámez-Virués et al. 2015.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do you think it is possible in SAS?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you very much for your advices!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Mar 2016 13:14:50 GMT</pubDate>
    <dc:creator>celdelmas</dc:creator>
    <dc:date>2016-03-11T13:14:50Z</dc:date>
    <item>
      <title>SGPLOT, VBAR, changing width of the bar according to a variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-changing-width-of-the-bar-according-to-a-variable/m-p/256063#M9285</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to konw if it is possible to create bar plots (VBARS for example) and set up the width of the bars according to a variable (the relative abundance of each category).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To illustrate my question, here is a&amp;nbsp;plot from this paper (&lt;SPAN&gt;&lt;A href="http://bit.ly/1nC991b)" target="_blank"&gt;http://bit.ly/1nC991b)&lt;/A&gt; &amp;nbsp;(Figure 3b).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It is exactely the type of plot I need to do for a ungoing project!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2284iB3EF96F8F455DAE1/image-size/medium?v=mpbl-1&amp;amp;px=-1" border="0" alt="Capture d’écran 2016-03-11 à 11.45.44.png" title="Capture d’écran 2016-03-11 à 11.45.44.png" /&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="page" title="Page 5"&gt;
&lt;DIV class="layoutArea"&gt;
&lt;DIV class="column"&gt;
&lt;P&gt;&lt;SPAN&gt;"The width of the bars represents relative abundance and the black component indicates the proportion of generalist feeders within the whole community: the higher the bar, the greater the proportion"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Gámez-Virués, S., Perović, D. J., Gossner, M. M., Börschig, C., Blüthgen, N., de Jong, H., ... &amp;amp; Scherber, C. (2015). Landscape simplification filters species traits and drives biotic homogenization. &lt;/SPAN&gt;&lt;I&gt;Nature communications&lt;/I&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;I&gt;6&lt;/I&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is the (simplified) code for the plot I am working on:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Habit is a categorical variable with 2 values.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;size is a categorical variable with 3 values&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;cate_col is a categorical variable with 2 values&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;FreqLFcol_cate is a table obtained with PROC FREQ&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=trait; by habit size;run;&lt;BR /&gt;proc freq data=trait;&lt;BR /&gt;by habit size;&lt;BR /&gt;table cate_flo / out=FreqLFcol_cate ;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sgpanel data=FreqLFcol_cate;&lt;BR /&gt;panelby habit ;&lt;BR /&gt;vbar size / response=Percent group=cate_flo grouporder=data groupdisplay=stack;&lt;BR /&gt;&lt;BR /&gt;rowaxis label = 'Percentage of species ' ;&lt;BR /&gt;colaxis label = 'size ';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;I would to set up the width of the bars according to&amp;nbsp;the relative abundance of species in the "size" variable as done by&amp;nbsp;&lt;SPAN&gt;Gámez-Virués et al. 2015.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do you think it is possible in SAS?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you very much for your advices!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2016 13:14:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-changing-width-of-the-bar-according-to-a-variable/m-p/256063#M9285</guid>
      <dc:creator>celdelmas</dc:creator>
      <dc:date>2016-03-11T13:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT, VBAR, changing width of the bar according to a variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-changing-width-of-the-bar-according-to-a-variable/m-p/256078#M9286</link>
      <description>&lt;P&gt;You may want to sort out your code box, its all on one line (i.e. put each code line on a newline, use indents etc.). &amp;nbsp;AS for your request, have a look here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/" target="_blank"&gt;http://blogs.sas.com/content/graphicallyspeaking/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This has examples of every type of graph you can imagine. &amp;nbsp;For your type of graph, I would imagine polygon is probably the nearest:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2013/12/24/new-polygon-plot/" target="_blank"&gt;http://blogs.sas.com/content/graphicallyspeaking/2013/12/24/new-polygon-plot/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2016 11:40:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-changing-width-of-the-bar-according-to-a-variable/m-p/256078#M9286</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-11T11:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT, VBAR, changing width of the bar according to a variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-changing-width-of-the-bar-according-to-a-variable/m-p/256104#M9288</link>
      <description>&lt;P&gt;Thank you for your quick reply, for some reason the code is all on one line, could not manage to change that.. not sure why.&lt;/P&gt;
&lt;P&gt;I didn't know the polygon plots!! Looks perfect for my needs, I'll give it a try!&lt;/P&gt;
&lt;P&gt;Thank you very much&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2016 13:16:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-changing-width-of-the-bar-according-to-a-variable/m-p/256104#M9288</guid>
      <dc:creator>celdelmas</dc:creator>
      <dc:date>2016-03-11T13:16:58Z</dc:date>
    </item>
  </channel>
</rss>

