<?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 label the data points of the graphic with their observation number in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-label-the-data-points-of-the-graphic-with-their/m-p/517235#M3300</link>
    <description>&lt;P&gt;Here is a minimal example using the SASHELP.CLASS data set with Proc SGPLOT&lt;/P&gt;
&lt;PRE&gt;proc sgplot data = sashelp.class;
   scatter x=height y=weight/datalabel=name;
run;&lt;/PRE&gt;
&lt;P&gt;you can use any of the variables in the data set with DATALABEL option to provide a label for the points. I recommend not using ones with long text though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have the observation number in the data use your variable name. If you don't , add it to the data prior to plotting possibly with something like&lt;/P&gt;
&lt;PRE&gt;data toplot;
   set components.corr;
   obs=_n_;
run;&lt;/PRE&gt;
&lt;P&gt;and use the toplot data set and datalabel=obs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Nov 2018 20:46:30 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-11-29T20:46:30Z</dc:date>
    <item>
      <title>How to label the data points of the graphic with their observation number</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-label-the-data-points-of-the-graphic-with-their/m-p/517193#M3294</link>
      <description>&lt;P&gt;I have a dataset with different observations and I want to plot those points in a 2D plot with the next code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC GPLOT DATA=components_corr;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;PLOT Prin1*Prin2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;SYMBOL1 VALUE=plus COLOR=blue POINTLABEL= ??;&amp;nbsp;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I dont know what to write in pointlabel in order to obtain a plot with different points and the number of observation of each point on it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 19:08:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-label-the-data-points-of-the-graphic-with-their/m-p/517193#M3294</guid>
      <dc:creator>Maider</dc:creator>
      <dc:date>2018-11-29T19:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to label the data points of the graphic with their observation number</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-label-the-data-points-of-the-graphic-with-their/m-p/517204#M3298</link>
      <description>&lt;P&gt;I think your best choice is to use the Statter Statement in PROC SGPLOT (Not GPLOT).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do a Google seach or check out the &lt;A href="https://blogs.sas.com/content/graphicallyspeaking/" target="_self"&gt;Graphically Speaking&lt;/A&gt; blog for examples.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 19:30:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-label-the-data-points-of-the-graphic-with-their/m-p/517204#M3298</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-11-29T19:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to label the data points of the graphic with their observation number</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-label-the-data-points-of-the-graphic-with-their/m-p/517235#M3300</link>
      <description>&lt;P&gt;Here is a minimal example using the SASHELP.CLASS data set with Proc SGPLOT&lt;/P&gt;
&lt;PRE&gt;proc sgplot data = sashelp.class;
   scatter x=height y=weight/datalabel=name;
run;&lt;/PRE&gt;
&lt;P&gt;you can use any of the variables in the data set with DATALABEL option to provide a label for the points. I recommend not using ones with long text though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have the observation number in the data use your variable name. If you don't , add it to the data prior to plotting possibly with something like&lt;/P&gt;
&lt;PRE&gt;data toplot;
   set components.corr;
   obs=_n_;
run;&lt;/PRE&gt;
&lt;P&gt;and use the toplot data set and datalabel=obs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 20:46:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-label-the-data-points-of-the-graphic-with-their/m-p/517235#M3300</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-29T20:46:30Z</dc:date>
    </item>
  </channel>
</rss>

