<?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 How to label a certain point in a scatter plot? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-certain-point-in-a-scatter-plot/m-p/453772#M15560</link>
    <description>&lt;P&gt;I am trying to label the point in the scatter plot with the smallest carbohydrate content, but so far I just have entered some text in the bottom left of the graph.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here it is my code and the data set:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA work.cereal;&lt;BR /&gt;INFILE "/folders/myfolders/cereal.txt"&lt;BR /&gt;DLM=',' FIRSTOBS=2 DSD MISSOVER;&lt;BR /&gt;INPUT Name :$50. Manufacturer $ Type $ Calories Protein Sodium Fiber Carbohydrates Sugars Potassium Vitamins Weight Cups;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;PROC PRINT DATA=work.cereal;&lt;BR /&gt;RUN; &lt;BR /&gt;&lt;BR /&gt;ODS GRAPHICS ON; &lt;BR /&gt;&lt;BR /&gt;PROC SGPLOT DATA=cereal;&lt;BR /&gt;SCATTER X=Sugars Y=Carbohydrates;&lt;BR /&gt;XAXIS GRID VALUES=(0 TO 15 BY 3); &lt;BR /&gt;YAXIS GRID;&lt;BR /&gt;INSET 'Quaker Oatmeal' / POSITION= BOTTOMLEFT;&lt;BR /&gt;TITLE 'Sugars vs Carbohydrates of Cereals';&lt;BR /&gt;RUN;&lt;/PRE&gt;</description>
    <pubDate>Thu, 12 Apr 2018 21:53:08 GMT</pubDate>
    <dc:creator>Miah</dc:creator>
    <dc:date>2018-04-12T21:53:08Z</dc:date>
    <item>
      <title>How to label a certain point in a scatter plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-certain-point-in-a-scatter-plot/m-p/453772#M15560</link>
      <description>&lt;P&gt;I am trying to label the point in the scatter plot with the smallest carbohydrate content, but so far I just have entered some text in the bottom left of the graph.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here it is my code and the data set:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA work.cereal;&lt;BR /&gt;INFILE "/folders/myfolders/cereal.txt"&lt;BR /&gt;DLM=',' FIRSTOBS=2 DSD MISSOVER;&lt;BR /&gt;INPUT Name :$50. Manufacturer $ Type $ Calories Protein Sodium Fiber Carbohydrates Sugars Potassium Vitamins Weight Cups;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;PROC PRINT DATA=work.cereal;&lt;BR /&gt;RUN; &lt;BR /&gt;&lt;BR /&gt;ODS GRAPHICS ON; &lt;BR /&gt;&lt;BR /&gt;PROC SGPLOT DATA=cereal;&lt;BR /&gt;SCATTER X=Sugars Y=Carbohydrates;&lt;BR /&gt;XAXIS GRID VALUES=(0 TO 15 BY 3); &lt;BR /&gt;YAXIS GRID;&lt;BR /&gt;INSET 'Quaker Oatmeal' / POSITION= BOTTOMLEFT;&lt;BR /&gt;TITLE 'Sugars vs Carbohydrates of Cereals';&lt;BR /&gt;RUN;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Apr 2018 21:53:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-certain-point-in-a-scatter-plot/m-p/453772#M15560</guid>
      <dc:creator>Miah</dc:creator>
      <dc:date>2018-04-12T21:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to label a certain point in a scatter plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-certain-point-in-a-scatter-plot/m-p/453777#M15561</link>
      <description>&lt;P&gt;I prefer using the TEXT or MARKERCHAR statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a quick example, it labels the oldest kid in the SASHELP.CLASS data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class; by descending age;
run;

data class_text;
set class;

if _n_=1 then text_value = "Oldest Kid";
run;

proc sgplot data=class_text;
scatter x=weight y=height;
text x=weight y=height text=text_value;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Apr 2018 22:04:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-certain-point-in-a-scatter-plot/m-p/453777#M15561</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-12T22:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to label a certain point in a scatter plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-certain-point-in-a-scatter-plot/m-p/453782#M15562</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One way would be create an annotate data set with the location variables&amp;nbsp;and appropriate instructions to display and reference that set using the SGANNO= option on the Proc statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SCATTER statement supports providing a value label to markers using the DATALABEL option. If you use DATALABEL=variablename it will use the value of the variable to label the marker.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So another way would be to determine that value and then add a variable that has a value only for the records of interest&amp;nbsp;to your plot dataset&amp;nbsp;to reference in the scatter plot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what do you want the label to be? The numeric value of the point? The value of a different variable? if so which?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 22:34:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-certain-point-in-a-scatter-plot/m-p/453782#M15562</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-12T22:34:01Z</dc:date>
    </item>
  </channel>
</rss>

