<?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: How to add reference line y=x to scatter plot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-reference-line-y-x-to-scatter-plot/m-p/17882#M377</link>
    <description>Is this for proc gplot?  I think the simplest way is to use the overlay option and plot one variable against itself.&lt;BR /&gt;
&lt;BR /&gt;
proc gplot data=dataset;&lt;BR /&gt;
plot y*x x*x/overlay;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
You could also create another dummy variable that spans the x/y axis in case there isn't enough variability in x or y.&lt;BR /&gt;
&lt;BR /&gt;
Using an annotated dataset would also work.</description>
    <pubDate>Fri, 25 Feb 2011 18:50:52 GMT</pubDate>
    <dc:creator>RickM</dc:creator>
    <dc:date>2011-02-25T18:50:52Z</dc:date>
    <item>
      <title>How to add reference line y=x to scatter plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-reference-line-y-x-to-scatter-plot/m-p/17881#M376</link>
      <description>How can I add the y=x line to my scatter plots?&lt;BR /&gt;
Thanks</description>
      <pubDate>Fri, 25 Feb 2011 18:05:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-reference-line-y-x-to-scatter-plot/m-p/17881#M376</guid>
      <dc:creator>Jackie418</dc:creator>
      <dc:date>2011-02-25T18:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference line y=x to scatter plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-reference-line-y-x-to-scatter-plot/m-p/17882#M377</link>
      <description>Is this for proc gplot?  I think the simplest way is to use the overlay option and plot one variable against itself.&lt;BR /&gt;
&lt;BR /&gt;
proc gplot data=dataset;&lt;BR /&gt;
plot y*x x*x/overlay;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
You could also create another dummy variable that spans the x/y axis in case there isn't enough variability in x or y.&lt;BR /&gt;
&lt;BR /&gt;
Using an annotated dataset would also work.</description>
      <pubDate>Fri, 25 Feb 2011 18:50:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-reference-line-y-x-to-scatter-plot/m-p/17882#M377</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2011-02-25T18:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference line y=x to scatter plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-reference-line-y-x-to-scatter-plot/m-p/17883#M378</link>
      <description>Thanks. I just meant is there a way to plot a reference line with 0 intercept and slope = 1.</description>
      <pubDate>Fri, 25 Feb 2011 18:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-reference-line-y-x-to-scatter-plot/m-p/17883#M378</guid>
      <dc:creator>Jackie418</dc:creator>
      <dc:date>2011-02-25T18:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference line y=x to scatter plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-reference-line-y-x-to-scatter-plot/m-p/17884#M379</link>
      <description>I am trying to make agreement plots without using the Ttest procedure in GPLOT or SGPLOT.</description>
      <pubDate>Fri, 25 Feb 2011 19:01:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-reference-line-y-x-to-scatter-plot/m-p/17884#M379</guid>
      <dc:creator>Jackie418</dc:creator>
      <dc:date>2011-02-25T19:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference line y=x to scatter plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-reference-line-y-x-to-scatter-plot/m-p/17885#M380</link>
      <description>Right, plotting any variable against itself is a line with an intercept at 0 and slope of 1 (x=1*x+0).  SAS has options to add vertical or horizontal reference lines (x=5 or y=10) but not for x=y.  That it why you would need to either plot another line (x*x or y*y) or use the annotation facility to draw a line on top of the graph.</description>
      <pubDate>Fri, 25 Feb 2011 19:04:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-reference-line-y-x-to-scatter-plot/m-p/17885#M380</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2011-02-25T19:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference line y=x to scatter plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-reference-line-y-x-to-scatter-plot/m-p/17886#M381</link>
      <description>Doh!  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thank you very much!</description>
      <pubDate>Fri, 25 Feb 2011 19:09:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-reference-line-y-x-to-scatter-plot/m-p/17886#M381</guid>
      <dc:creator>Jackie418</dc:creator>
      <dc:date>2011-02-25T19:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference line y=x to scatter plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-reference-line-y-x-to-scatter-plot/m-p/17887#M382</link>
      <description>hi ... just to add onto the x*x suggestion already made ...&lt;BR /&gt;
&lt;BR /&gt;
* some fake data;&lt;BR /&gt;
data x;&lt;BR /&gt;
do x = 1 to 10;&lt;BR /&gt;
   y = 6 + ceil(10*ranuni(999));&lt;BR /&gt;
   output;&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
goptions reset=all;&lt;BR /&gt;
&lt;BR /&gt;
symbol1 v=dot c=blue;&lt;BR /&gt;
symbol2 i=join c=blue ;&lt;BR /&gt;
&lt;BR /&gt;
proc gplot data=x;&lt;BR /&gt;
  plot (y x)*x / overlay;&lt;BR /&gt;
run;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
also, using annotate is actually a bit harder in that the above method does not require you to have any knowledge as to how SAS/Graph will choose the ranges of  the x and y axes&lt;BR /&gt;
&lt;BR /&gt;
if you use annotate, then only safe way to add the line is to control the axis ranges with AXIS statements that specify ORDER and then use that axis range info to specify end points of a line drawn with annotate</description>
      <pubDate>Sat, 26 Feb 2011 04:30:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-reference-line-y-x-to-scatter-plot/m-p/17887#M382</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2011-02-26T04:30:03Z</dc:date>
    </item>
  </channel>
</rss>

