<?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: Proc sgplot split graph space equally by group in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-sgplot-split-graph-space-equally-by-group/m-p/838686#M331604</link>
    <description>&lt;P&gt;Another option might be SGPANEL creating one graph for each value of the group variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sgpanel data = dataset;
   panelby study_arm  / onepanel uniscale=row columns=2 layout=columnlattice;
   scatter x= Days y= ID ;

run;&lt;/PRE&gt;
&lt;P&gt;The ONEPANEL option to force all the plots into one may be overkill, the Uniscale=row means that the vertical axis will be the same and allow different horizontal axis in each panel, Columns= should be the number of levels of the group variable. If the columns is more than 3 or 4 then you may need to play with ODS Graphics settings to provide a larger plot area.&lt;/P&gt;
&lt;P&gt;By default each panel should be the same physical size.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2022 17:51:22 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-10-14T17:51:22Z</dc:date>
    <item>
      <title>Proc sgplot split graph space equally by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sgplot-split-graph-space-equally-by-group/m-p/838641#M331577</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to create a scatterplot for a dataset with two groups. Number of observations in one group are much fewer compared to the other group. When I plot this graph using sgplot, most of the plot area obviously is covered by the group with higher number of observations. Is there a way to adjust this such that the plot area is split into half for each group? I assume there will be some additional white space in the area where there aren't enough observations, which is okay.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My basic code for creating the graph is below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data = dataset;&lt;/P&gt;
&lt;P&gt;scatter x= Days y= ID /group = study_arm;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 14:53:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sgplot-split-graph-space-equally-by-group/m-p/838641#M331577</guid>
      <dc:creator>analyst_work</dc:creator>
      <dc:date>2022-10-14T14:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sgplot split graph space equally by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sgplot-split-graph-space-equally-by-group/m-p/838650#M331580</link>
      <description>&lt;P&gt;Not automatically but you can split/break the axis based on your knowledge of the data.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data = dataset;

scatter x= Days y= ID /group = study_arm;
xaxis ranges=(min - someValue nextValue-high) values = (Min to Max by Interval);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2015/09/02/broken-axis-redux/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2015/09/02/broken-axis-redux/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/85450"&gt;@analyst_work&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to create a scatterplot for a dataset with two groups. Number of observations in one group are much fewer compared to the other group. When I plot this graph using sgplot, most of the plot area obviously is covered by the group with higher number of observations. Is there a way to adjust this such that the plot area is split into half for each group? I assume there will be some additional white space in the area where there aren't enough observations, which is okay.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My basic code for creating the graph is below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data = dataset;&lt;/P&gt;
&lt;P&gt;scatter x= Days y= ID /group = study_arm;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 15:26:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sgplot-split-graph-space-equally-by-group/m-p/838650#M331580</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-14T15:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sgplot split graph space equally by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sgplot-split-graph-space-equally-by-group/m-p/838686#M331604</link>
      <description>&lt;P&gt;Another option might be SGPANEL creating one graph for each value of the group variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sgpanel data = dataset;
   panelby study_arm  / onepanel uniscale=row columns=2 layout=columnlattice;
   scatter x= Days y= ID ;

run;&lt;/PRE&gt;
&lt;P&gt;The ONEPANEL option to force all the plots into one may be overkill, the Uniscale=row means that the vertical axis will be the same and allow different horizontal axis in each panel, Columns= should be the number of levels of the group variable. If the columns is more than 3 or 4 then you may need to play with ODS Graphics settings to provide a larger plot area.&lt;/P&gt;
&lt;P&gt;By default each panel should be the same physical size.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 17:51:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sgplot-split-graph-space-equally-by-group/m-p/838686#M331604</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-14T17:51:22Z</dc:date>
    </item>
  </channel>
</rss>

