<?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: SAS proc sgplot vbox scatter overlay groups not aligned in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SAS-proc-sgplot-vbox-scatter-overlay-groups-not-aligned/m-p/832487#M23155</link>
    <description>&lt;P&gt;Sorry, maybe try adding groupdisplay=cluster and specifying clusterwidth in both plots:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    groupdisplay = cluster
    clusterwidth=.5
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It looks like that should do it. You might want to play with the value.&amp;nbsp; My guess is the vbox might have a different default clusterwidth than scatter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if I'm wrong again, then check out this blog post by graphing guru Sanjay Matange.&amp;nbsp; It has a nice example of boxplot overlayed with scatter plot, with groups.&amp;nbsp;&amp;nbsp;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2015/12/23/box-plot-with-stat-table-and-markers/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2015/12/23/box-plot-with-stat-table-and-markers/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Sep 2022 13:01:33 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2022-09-09T13:01:33Z</dc:date>
    <item>
      <title>SAS proc sgplot vbox scatter overlay groups not aligned</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SAS-proc-sgplot-vbox-scatter-overlay-groups-not-aligned/m-p/832476#M23152</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use proc sgplot with the vbox and scatter statements to create an overlaid graph. I have seven groups ("grp") and three timepoints ("day"), with timepoint to be plotted on the x-axis and the plots to be split by group. I am using the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sgplot data=data.sample;
	vbox aval / 
		group = grp
		category = day
		nooutliers;
	scatter x=day y=aval / 
		group = grp
		groupdisplay = cluster
		jitter;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&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-left" image-alt="test_figure.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75087iD31B9FF08AEA0F42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="test_figure.png" alt="test_figure.png" /&gt;&lt;/span&gt;The plot itself is generating as expected. However, as you can see in the adjacent image, the offset from the x-axis timepoint ticks for each group is not aligned for the scatter plot clusters and the box plots. &lt;STRONG&gt;Why is this happening and how do I fix it?&lt;/STRONG&gt; I would like the layout to be in the same format for all groups as it currently is for Group 4 (i.e., scatter plot cluster directly on top of box plot).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NB: I know the graph looks a bit weird and smushed in this format, it's made using dummy data. The distribution with the real data will be much cleaner.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using Enterprise Guide version 8.3.3.181. A dummy dataset is attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 12:10:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SAS-proc-sgplot-vbox-scatter-overlay-groups-not-aligned/m-p/832476#M23152</guid>
      <dc:creator>smillard</dc:creator>
      <dc:date>2022-09-09T12:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS proc sgplot vbox scatter overlay groups not aligned</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SAS-proc-sgplot-vbox-scatter-overlay-groups-not-aligned/m-p/832477#M23153</link>
      <description>&lt;P&gt;Try removing groupdisplay=cluster from the scatter plot.&amp;nbsp; I don't think you need it, and I think the clustering is causing your problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or if you want the clustering, than try adding&amp;nbsp;groupdisplay=cluster to the vbox.&amp;nbsp; That should work too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So basically you want both plots clustered or neither clustered.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 12:21:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SAS-proc-sgplot-vbox-scatter-overlay-groups-not-aligned/m-p/832477#M23153</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2022-09-09T12:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: SAS proc sgplot vbox scatter overlay groups not aligned</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SAS-proc-sgplot-vbox-scatter-overlay-groups-not-aligned/m-p/832478#M23154</link>
      <description>&lt;P&gt;Thanks Quentin, have just tried both options and sadly they didn't fix it. Removing the groupdisplay=cluster from the scatter statement causes all points to display in one line at each day, and adding it to the vbox statement didn't change the layout from the original code.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 12:27:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SAS-proc-sgplot-vbox-scatter-overlay-groups-not-aligned/m-p/832478#M23154</guid>
      <dc:creator>smillard</dc:creator>
      <dc:date>2022-09-09T12:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS proc sgplot vbox scatter overlay groups not aligned</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SAS-proc-sgplot-vbox-scatter-overlay-groups-not-aligned/m-p/832487#M23155</link>
      <description>&lt;P&gt;Sorry, maybe try adding groupdisplay=cluster and specifying clusterwidth in both plots:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    groupdisplay = cluster
    clusterwidth=.5
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It looks like that should do it. You might want to play with the value.&amp;nbsp; My guess is the vbox might have a different default clusterwidth than scatter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if I'm wrong again, then check out this blog post by graphing guru Sanjay Matange.&amp;nbsp; It has a nice example of boxplot overlayed with scatter plot, with groups.&amp;nbsp;&amp;nbsp;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2015/12/23/box-plot-with-stat-table-and-markers/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2015/12/23/box-plot-with-stat-table-and-markers/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 13:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SAS-proc-sgplot-vbox-scatter-overlay-groups-not-aligned/m-p/832487#M23155</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2022-09-09T13:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS proc sgplot vbox scatter overlay groups not aligned</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SAS-proc-sgplot-vbox-scatter-overlay-groups-not-aligned/m-p/832490#M23156</link>
      <description>That did it thanks! Used clusterwidth = 0.7</description>
      <pubDate>Fri, 09 Sep 2022 13:06:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SAS-proc-sgplot-vbox-scatter-overlay-groups-not-aligned/m-p/832490#M23156</guid>
      <dc:creator>smillard</dc:creator>
      <dc:date>2022-09-09T13:06:28Z</dc:date>
    </item>
  </channel>
</rss>

