<?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 use JITTER option with MARKERCHAR option in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/853426#M23413</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
You could combine them together 
*/
data have;
input x y outlier $1.;
cards;
2 5 A
3 8 B
3 8 B
3 8 A
3 4 A
3 8 A
3 9 B
4 3 B
4 3 B
4 3 B
4 4 A
6 8 B
5 9 A
2 8 A
;

proc sort data=have out=temp;by x y;run;
data want; 
do until(last.y);
 set temp;
 by x y;
 length label $ 80;
 label=cats(label,outlier);
end;
run;
proc sgplot data=want noautolegend;
scatter x=x y=y /markerchar=label markercharattrs=(color=red size=10) labelstrip ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1673523336606.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79310i2EE4E721A552BEB7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1673523336606.png" alt="Ksharp_0-1673523336606.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jan 2023 11:36:07 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2023-01-12T11:36:07Z</dc:date>
    <item>
      <title>PROC SGPLOT use JITTER option with MARKERCHAR option</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/852852#M23402</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently have code to plot data points that are visually represented based on the value of the "Outlier" variable using the MARKERCHAR option, which has values "A" or "B" (points show up as A or B on the plot). I have recently run into a situation where there are multiple points that have the same values, and they only show up as one point. I tried using the JITTER option, but it does not seem to work with MARKERCHAR. If I remove the MARKERCHAR option, JITTER works fine, and the multiple points are shown. Is there any workaround to have both options work? My code is below. Thanks!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC SGPLOT DATA = Data_Outliers&amp;nbsp; DESCRIPTION = "Scatter Box Plot" NOAUTOLEGEND ;
VBOX Value / CATEGORY=An_Run MEANATTRS=(SIZE=0) NOOUTLIERS FILLATTRS=(COLOR="Gray") PERCENTILE=4 ;
SCATTER X = An_Run Y = Anal_Biol / JITTER MARKERCHAR=Outlier MARKERCHARATTRS=(COLOR="Red") ;
RUN ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 16:35:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/852852#M23402</guid>
      <dc:creator>aabdesse</dc:creator>
      <dc:date>2023-01-09T16:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT use JITTER option with MARKERCHAR option</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/853017#M23405</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/438296"&gt;@aabdesse&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If jittering is requested with Marker Characters at a high DPI, then the marker characters seem to collide.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's not considered as a bug.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think it's in the documentation somewhere ...&lt;BR /&gt;... that jittering is not supported when MARKERCHARACTER= or MARKERSIZERESPONSE= is in effect. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS does not always issue a LOG message when interaction of options like this happens.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, the behaviour you see is documented.&lt;BR /&gt;However , how to achieve what you want to achieve? About the latter, I still need to think a bit. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;More news later (hopefully).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;BR /&gt;Koen&lt;/P&gt;
&lt;DIV id="ConnectiveDocSignExtentionInstalled" data-extension-version="1.0.4"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 Jan 2023 08:54:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/853017#M23405</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-01-10T08:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT use JITTER option with MARKERCHAR option</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/853041#M23406</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
If you want answer, 
you should post some data to test your code.
*/
data have;
input x y outlier $;
cards;
2 5 A
3 8 B
3 8 B
3 8 A
3 8 A
4 3 B
4 3 B
4 3 B
6 8 B
5 9 A
2 8 A
;

proc sort data=have out=temp;by x y;run;
data temp;
 set temp;
 by x y;
 if first.y then group=0;
 group+1;
run;
proc sgplot data=temp noautolegend;
scatter x=x y=y /markerchar=outlier markercharattrs=(color=red size=10)
   group=group groupdisplay=cluster clusterwidth=0.3;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1673350932236.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79222i31F7DDE778BF783B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1673350932236.png" alt="Ksharp_0-1673350932236.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 11:42:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/853041#M23406</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-01-10T11:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT use JITTER option with MARKERCHAR option</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/853229#M23408</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
This code is more simple.
DATALABEL has the same effect with JITTER.
*/

data have;
input x y outlier $;
cards;
2 5 A
3 8 B
3 8 B
3 8 A
3 8 A
4 3 B
4 3 B
4 3 B
6 8 B
5 9 A
2 8 A
;


proc sgplot data=have noautolegend;
scatter x=x y=y /datalabel=outlier markerattrs=(size=0) datalabelattrs=(size=10 color=red) ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1673437392485.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79269i3D9325D60B665BA2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1673437392485.png" alt="Ksharp_0-1673437392485.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 11:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/853229#M23408</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-01-11T11:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT use JITTER option with MARKERCHAR option</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/853315#M23409</link>
      <description>&lt;P&gt;The code above is indeed simpler, however it offsets the position on the y axis when there are more than 2 values, whereas your previous example keeps them all on the same level (which for me is important as I am dealing with continuous values on the y-axis as opposed to discrete ones like in your example).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 18:12:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/853315#M23409</guid>
      <dc:creator>aabdesse</dc:creator>
      <dc:date>2023-01-11T18:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT use JITTER option with MARKERCHAR option</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/853318#M23410</link>
      <description>&lt;P&gt;This looks good! There is only one issue I encounter when doing it this way. If I add more y values for the same x values (on the same vertical line), then the values that are not grouped together are not centered with the vertical line corresponding to the x value. I've added a few values to your example to illustrate it. Is there any way to keep everything centered? With my actual dataset, I also have boxplots in the same plot, and it looks odd when the points are not centered. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data have;
input x y outlier $;
cards;
2 5 A
3 8 B
3 8 B
3 8 A
3 4 A
3 8 A
4 3 B
4 3 B
4 3 B
4 4 A
6 8 B
5 9 A
2 8 A
;

proc sort data=have out=temp;by x y;run;
data temp;
 set temp;
 by x y;
 if first.y then group=0;
 group+1;
run;
proc sgplot data=temp noautolegend;
scatter x=x y=y /markerchar=outlier markercharattrs=(color=red size=10)
   group=group groupdisplay=cluster clusterwidth=0.3;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79293i97889C69F3D582D8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SGPlot.png" alt="SGPlot.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 18:19:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/853318#M23410</guid>
      <dc:creator>aabdesse</dc:creator>
      <dc:date>2023-01-11T18:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT use JITTER option with MARKERCHAR option</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/853426#M23413</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
You could combine them together 
*/
data have;
input x y outlier $1.;
cards;
2 5 A
3 8 B
3 8 B
3 8 A
3 4 A
3 8 A
3 9 B
4 3 B
4 3 B
4 3 B
4 4 A
6 8 B
5 9 A
2 8 A
;

proc sort data=have out=temp;by x y;run;
data want; 
do until(last.y);
 set temp;
 by x y;
 length label $ 80;
 label=cats(label,outlier);
end;
run;
proc sgplot data=want noautolegend;
scatter x=x y=y /markerchar=label markercharattrs=(color=red size=10) labelstrip ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1673523336606.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79310i2EE4E721A552BEB7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1673523336606.png" alt="Ksharp_0-1673523336606.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 11:36:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/853426#M23413</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-01-12T11:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT use JITTER option with MARKERCHAR option</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/853518#M23416</link>
      <description>&lt;P&gt;That's perfect! Thank you so much!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 17:37:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-use-JITTER-option-with-MARKERCHAR-option/m-p/853518#M23416</guid>
      <dc:creator>aabdesse</dc:creator>
      <dc:date>2023-01-12T17:37:39Z</dc:date>
    </item>
  </channel>
</rss>

