<?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: Scatterplot looks weird in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916289#M24367</link>
    <description>&lt;P&gt;Your data in both variables&amp;nbsp;&lt;SPAN&gt;rNPS and pNPS take on only integer values. This is why you get the appearance shown. In addition, the correlation doesn't appear visually because you may have 1000 data points at a given position on the plot, all are shown &lt;EM&gt;exactly&lt;/EM&gt; on top of one another (because they are all integers), making it look as if there is only a single data point on the plot.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A potential improvement is to use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/p1lcbd3lhs3t3bn1jk6d8sjt2yqx.htm#n1f5jayy00jt3cn1e7z8mjo5rl0m" target="_self"&gt;JITTER option&lt;/A&gt;&amp;nbsp;and the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/p1lcbd3lhs3t3bn1jk6d8sjt2yqx.htm#p07ie3pm7jsexvn1t3uv181irozh" target="_self"&gt;JITTERWIDTH option&lt;/A&gt; in the SCATTER statement in PROC SGPLOT.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Feb 2024 12:58:53 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2024-02-15T12:58:53Z</dc:date>
    <item>
      <title>Scatterplot looks weird</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916286#M24366</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a scatterplot with my variables rNPS and pNPS.&lt;BR /&gt;Unfortunately, the generated scatterplot looks very strange and I can't explain why.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code and the output scatterplot:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;ODS Graphics on;
proc sgplot data=xwrk.nps_ebenen_vollständig; 
scatter x=pnps y=rnps;
run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alica_1-1708000180831.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93780i207EB29799FBCE24/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Alica_1-1708000180831.png" alt="Alica_1-1708000180831.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I already checked the correlation between those two variables and there is a positive and significant correlation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone already had this problem and can help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 12:32:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916286#M24366</guid>
      <dc:creator>Alica</dc:creator>
      <dc:date>2024-02-15T12:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot looks weird</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916289#M24367</link>
      <description>&lt;P&gt;Your data in both variables&amp;nbsp;&lt;SPAN&gt;rNPS and pNPS take on only integer values. This is why you get the appearance shown. In addition, the correlation doesn't appear visually because you may have 1000 data points at a given position on the plot, all are shown &lt;EM&gt;exactly&lt;/EM&gt; on top of one another (because they are all integers), making it look as if there is only a single data point on the plot.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A potential improvement is to use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/p1lcbd3lhs3t3bn1jk6d8sjt2yqx.htm#n1f5jayy00jt3cn1e7z8mjo5rl0m" target="_self"&gt;JITTER option&lt;/A&gt;&amp;nbsp;and the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/p1lcbd3lhs3t3bn1jk6d8sjt2yqx.htm#p07ie3pm7jsexvn1t3uv181irozh" target="_self"&gt;JITTERWIDTH option&lt;/A&gt; in the SCATTER statement in PROC SGPLOT.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 12:58:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916289#M24367</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-02-15T12:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot looks weird</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916292#M24368</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=xwrk.nps_ebenen_vollständig; 
   scatter x=pnps y=rnps / jitter;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The JITTER option will add a small random offset to the X and Y variables before plotting the marker. (It doesn't change your data, only the plot.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 13:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916292#M24368</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2024-02-15T13:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot looks weird</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916325#M24369</link>
      <description>&lt;P&gt;with the jitter option I can now see small data points. I actually wanted to use the scatterplot to show a linear relationship between rNPS and pNPS. But due to the integer values this is a bit confusing in the scatterplot. Do you have any suggestions as to what I can do to show the linear relationship graphically?&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-inline" image-alt="Alica_0-1708014119754.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93788iBDA642F3A0E46459/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Alica_0-1708014119754.png" alt="Alica_0-1708014119754.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 16:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916325#M24369</guid>
      <dc:creator>Alica</dc:creator>
      <dc:date>2024-02-15T16:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot looks weird</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916326#M24370</link>
      <description>&lt;P&gt;To me, this does show the relationship. There is the most "ink" on the diagonal, and much less off-diagonal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, this is a limitation of plotting data like this which are all integers; the linear relationship can be hard to see.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 16:25:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916326#M24370</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-02-15T16:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot looks weird</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916329#M24371</link>
      <description>&lt;P&gt;Alright, thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to change the colour of the data points to see the relationship a little better?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 16:33:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916329#M24371</guid>
      <dc:creator>Alica</dc:creator>
      <dc:date>2024-02-15T16:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot looks weird</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916330#M24372</link>
      <description>&lt;P&gt;Use the REG statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=xwrk.nps_ebenen_vollständig; 
   reg x=pnps y=rnps / jitter;
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Feb 2024 16:35:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916330#M24372</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2024-02-15T16:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot looks weird</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916331#M24373</link>
      <description>&lt;P&gt;Yes of course you can change the color, but may I recommend the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/p1lcbd3lhs3t3bn1jk6d8sjt2yqx.htm#n0hjrs3w86z8ean1npu022im7j2ss" target="_self"&gt;TRANSPARENCY= option&lt;/A&gt;? This will make spots with lots of data darker than spots with a little bit of data. I don't know how it will work with integer data, you would still have to use the JITTER option, but please give it a try.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;And try it without the JITTER option as well, plotting integer data this way is something I have never tried, and so trying a bunch of different variations of the plot might turn up one that you really like.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 16:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916331#M24373</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-02-15T16:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot looks weird</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916333#M24374</link>
      <description>&lt;P&gt;If you want a crude use of color, you can overlay the curve and regression line on a heat map of the density of the data. I don't have access to your data, but it might look something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let DSName = xwrk.nps_ebenen_vollständig; 
%let XVar = pNPS;
%let YVar = rNPS;

proc sgplot data=&amp;amp;DSName; 
   heatmap x=&amp;amp;XVar y=&amp;amp;YVar / xbinsize=1 ybinsize=1 colormodel=TwoColorRamp;
   reg x=&amp;amp;XVar y=&amp;amp;YVar / 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="Rick_SAS_0-1708015952211.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93789iF6A5CE91968814C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rick_SAS_0-1708015952211.png" alt="Rick_SAS_0-1708015952211.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 16:52:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916333#M24374</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2024-02-15T16:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot looks weird</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916392#M24375</link>
      <description>Or you could "Create a contour plot in SAS"&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2012/07/02/create-a-contour-plot-in-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2012/07/02/create-a-contour-plot-in-sas.html&lt;/A&gt;</description>
      <pubDate>Fri, 16 Feb 2024 03:06:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916392#M24375</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-02-16T03:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot looks weird</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916421#M24376</link>
      <description>&lt;P&gt;Thank you so much, guys!&lt;/P&gt;&lt;P&gt;That helped a lot&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 10:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916421#M24376</guid>
      <dc:creator>Alica</dc:creator>
      <dc:date>2024-02-16T10:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot looks weird</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916794#M24380</link>
      <description>&lt;P&gt;Do you have additional questions? If not, please mark this thread as SOLVED.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 14:50:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/916794#M24380</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2024-02-19T14:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot looks weird</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/919696#M24437</link>
      <description>&lt;P&gt;Depending on your data, I've found &lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2017/12/19/getting-started-sgplot-part-9-bubble-plot/" target="_self"&gt;bubble plots&lt;/A&gt; helpful to show that some points have more values than others.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Mar 2024 19:08:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Scatterplot-looks-weird/m-p/919696#M24437</guid>
      <dc:creator>tc</dc:creator>
      <dc:date>2024-03-10T19:08:16Z</dc:date>
    </item>
  </channel>
</rss>

