<?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: overlay jitter scatter plot on boxplot in sgplot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/433566#M14972</link>
    <description>&lt;P&gt;You can overlay the Band and the Scatter without any issues.&amp;nbsp; Adding VBox is the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since all data markers are already in the plot&amp;nbsp;(Scatter) you only need to overplot the Q1-Q3 box, Mean, Median and Whiskers.&amp;nbsp; One way to do this would be to first run&amp;nbsp;PROC MEANS to get these values in an output data set.&amp;nbsp; Then merge these with the original data, and use HighLow plot(s) overlay to draw the box details along with the Scatter and Band.&amp;nbsp; Use another scatter for the Mean marker.&amp;nbsp; I suggest dimming (transparency) the scatter markers to avoid clutter.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Feb 2018 15:25:44 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2018-02-02T15:25:44Z</dc:date>
    <item>
      <title>overlay jitter scatter plot on boxplot in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/389992#M13366</link>
      <description>&lt;P&gt;I want to add jitter scatter plot on my boxplot. &amp;nbsp;I used sgplot to produce my boxplot. &amp;nbsp;I found this post here&amp;nbsp;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2012/05/07/unbox-your-box-plots/" target="_blank"&gt;http://blogs.sas.com/content/graphicallyspeaking/2012/05/07/unbox-your-box-plots/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The picture is exactly what I want but I wonder if I can produce it with sgplot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my sgplot code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=box;&lt;BR /&gt;/* title "Plot of Hemoglobin A1c - baseline";*/&lt;BR /&gt;YAXIS label='Diastolic blood pressure' LABELATTRS=(SIZE= 8);&lt;BR /&gt;XAXIS label=' ' LABELATTRS=(SIZE= 8);&lt;BR /&gt;vbox result / datalabel=outid;&lt;BR /&gt;ods output SGPlot=boxlist;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 19:21:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/389992#M13366</guid>
      <dc:creator>mmzz</dc:creator>
      <dc:date>2017-08-22T19:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: overlay jitter scatter plot on boxplot in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/390020#M13367</link>
      <description>&lt;P&gt;If you search your documentation for SGPLOT and SGPANEL for "Plot Type Compatibility" you will find that in those procedures the only plots that can be used together with VBOX are Density, HBOX and Histogram.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The nature of the plot determines which other types share the "plot space".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may be possible with an annotate dataset with SGPLOT but no promises.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OR sumarize your data and possibly use Polygon and lineparm or such along with scatter to simulate the VBOX portion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 20:38:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/390020#M13367</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-22T20:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: overlay jitter scatter plot on boxplot in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/390037#M13368</link>
      <description>Pretty sure this was asked and answered recently on here. Search through the forums. You may also be interested in the default plots from PROC UNIVARIATE, they do a good job of displaying the distribution of data.</description>
      <pubDate>Tue, 22 Aug 2017 21:36:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/390037#M13368</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-22T21:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: overlay jitter scatter plot on boxplot in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/390040#M13370</link>
      <description>&lt;P&gt;If you have SAS 9.4, maintenance 1 or greater, you can do it like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.cars;
vbox weight / category=type;
scatter x=type y=weight / jitter;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot2.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/14596i795AE6E7DF875B8F/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot2.png" alt="SGPlot2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 21:45:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/390040#M13370</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2017-08-22T21:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: overlay jitter scatter plot on boxplot in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/433525#M14969</link>
      <description>&lt;P&gt;is there any way to overlay jitter scatter plot on boxplot&amp;nbsp;along with ViolinPlot&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 14:05:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/433525#M14969</guid>
      <dc:creator>Nagadurga</dc:creator>
      <dc:date>2018-02-02T14:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: overlay jitter scatter plot on boxplot in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/433555#M14970</link>
      <description>&lt;P&gt;See this article in Graphically Speaking.&amp;nbsp; It is a bit old, and there may be easier ways to do this using SAS 9.4 or later.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2012/10/30/violin-plots/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2012/10/30/violin-plots/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 15:13:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/433555#M14970</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2018-02-02T15:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: overlay jitter scatter plot on boxplot in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/433558#M14971</link>
      <description>&lt;P&gt;Hello Sanjay,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I am trying to overlay a Boxplot, Scatterplot and ViolinPlot.For this I am using PROC SGPLOT with sas 94.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example code is as below to produce boxplot + scatterplot.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;However when one adds the bandplot to this, then it does not work anymore.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;See the warning below obtained when adding a bandplot statement.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; sgplot data=ars;&lt;/P&gt;&lt;P&gt;vbox rcbi / category=arm2 boxwidth=0.4 nooutliers;&lt;/P&gt;&lt;P&gt;scatter x=arm2 y=rcbi / group=arm2&amp;nbsp; jitter transparency=0.6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;markerattrs=(/*color=red*/ symbol=CircleFilled);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WARNING: BANDPLOT statement has a conflict with the axis type. The plot will not be drawn.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the same when using proc SGPANEL.&lt;/P&gt;&lt;P&gt;I can create the violin plot using band statement using code below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; sgpanel data=final;&lt;/P&gt;&lt;P&gt;panelby arm2;&lt;/P&gt;&lt;P&gt;band y=rcbi2 lower=mirror upper=density;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;But it does not work anymore if I add the vbox and scatter statement on top …&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Let me know if any thoughts&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 15:16:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/433558#M14971</guid>
      <dc:creator>Nagadurga</dc:creator>
      <dc:date>2018-02-02T15:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: overlay jitter scatter plot on boxplot in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/433566#M14972</link>
      <description>&lt;P&gt;You can overlay the Band and the Scatter without any issues.&amp;nbsp; Adding VBox is the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since all data markers are already in the plot&amp;nbsp;(Scatter) you only need to overplot the Q1-Q3 box, Mean, Median and Whiskers.&amp;nbsp; One way to do this would be to first run&amp;nbsp;PROC MEANS to get these values in an output data set.&amp;nbsp; Then merge these with the original data, and use HighLow plot(s) overlay to draw the box details along with the Scatter and Band.&amp;nbsp; Use another scatter for the Mean marker.&amp;nbsp; I suggest dimming (transparency) the scatter markers to avoid clutter.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 15:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/433566#M14972</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2018-02-02T15:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: overlay jitter scatter plot on boxplot in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/506965#M17264</link>
      <description>&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 18:21:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/overlay-jitter-scatter-plot-on-boxplot-in-sgplot/m-p/506965#M17264</guid>
      <dc:creator>smitham</dc:creator>
      <dc:date>2018-10-23T18:21:23Z</dc:date>
    </item>
  </channel>
</rss>

