<?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: Labels in SGPLOT in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Labels-in-SGPLOT/m-p/607065#M19157</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/173881"&gt;@Junyong&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;In SGPLOT, DATALABEL or CURVELABEL can be used to write some contents inside.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot.png" style="width: 320px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34194iD7C038B36D2C05A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot.png" alt="SGPlot.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot1.png" style="width: 320px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34195iFBA035F1854344BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot1.png" alt="SGPlot1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I have two questions.&lt;/P&gt;
&lt;P&gt;1. When SGPLOT SCATTER, can I completely alter the symbols (dots, triangles, etc.) by their DATALABEL? In the attached example, I want to delete the symbols but want to alter them by the numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I am not sure exactly what you mean by "delete the symbols but want to alter them by the numbers". If you really mean that you only want to display the number value an no marker at all them perhaps you want a text plot:&lt;/P&gt;
&lt;PRE&gt;proc sgplot ;
text x=x y=y text=i /group=i;
run;
&lt;/PRE&gt;</description>
    <pubDate>Mon, 25 Nov 2019 17:11:53 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-11-25T17:11:53Z</dc:date>
    <item>
      <title>Labels in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Labels-in-SGPLOT/m-p/606631#M19153</link>
      <description>&lt;P&gt;In SGPLOT, DATALABEL or CURVELABEL can be used to write some contents inside.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot.png" style="width: 320px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34194iD7C038B36D2C05A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot.png" alt="SGPlot.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot1.png" style="width: 320px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34195iFBA035F1854344BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot1.png" alt="SGPlot1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have two questions.&lt;/P&gt;&lt;P&gt;1. When SGPLOT SCATTER, can I completely alter the symbols (dots, triangles, etc.) by their DATALABEL? In the attached example, I want to delete the symbols but want to alter them by the numbers.&lt;/P&gt;&lt;P&gt;2. When SGPLOT SERIES, can I automatically put the very ending numbers of the groups as CURVELABEL? CURVELABEL puts the group names, but I need the last values of the lines.&lt;/P&gt;&lt;P&gt;Here I append the code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _;
do i=1 to 10;
do j=1 to 10;
x=rannor(1);
y=x+rannor(1);
if j=1 then z=0;
else z+rannor(1);
output;
end;
end;
run;
ods listing gpath="!userprofile\desktop\";
ods graphics/reset=index;
ods results=off;
proc sgplot;
scatter x=x y=y/group=i datalabel=j;
run;
proc sgplot;
series x=j y=z/group=i curvelabel;
run;
ods results=on;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks for your consideration.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2019 00:41:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Labels-in-SGPLOT/m-p/606631#M19153</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2019-11-23T00:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Labels in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Labels-in-SGPLOT/m-p/606642#M19154</link>
      <description>&lt;P&gt;2. Yes. But you need to modify your data a little bit. You can specify a variable as the label, depending on the version of SAS, assuming the newest, so leave the variable empty for every other value except the Last values and those will be displayed.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;AFAIK you can’t do #1 but I’d wait to see what others have to say.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/173881"&gt;@Junyong&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;In SGPLOT, DATALABEL or CURVELABEL can be used to write some contents inside.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot.png" style="width: 320px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34194iD7C038B36D2C05A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot.png" alt="SGPlot.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot1.png" style="width: 320px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34195iFBA035F1854344BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot1.png" alt="SGPlot1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I have two questions.&lt;/P&gt;
&lt;P&gt;1. When SGPLOT SCATTER, can I completely alter the symbols (dots, triangles, etc.) by their DATALABEL? In the attached example, I want to delete the symbols but want to alter them by the numbers.&lt;/P&gt;
&lt;P&gt;2. When SGPLOT SERIES, can I automatically put the very ending numbers of the groups as CURVELABEL? CURVELABEL puts the group names, but I need the last values of the lines.&lt;/P&gt;
&lt;P&gt;Here I append the code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _;
do i=1 to 10;
do j=1 to 10;
x=rannor(1);
y=x+rannor(1);
if j=1 then z=0;
else z+rannor(1);
output;
end;
end;
run;
ods listing gpath="!userprofile\desktop\";
ods graphics/reset=index;
ods results=off;
proc sgplot;
scatter x=x y=y/group=i datalabel=j;
run;
proc sgplot;
series x=j y=z/group=i curvelabel;
run;
ods results=on;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks for your consideration.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2019 01:59:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Labels-in-SGPLOT/m-p/606642#M19154</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-23T01:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Labels in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Labels-in-SGPLOT/m-p/606650#M19155</link>
      <description>For #1 you can use a data attribute map. I'd recommend changing colours for you I variable and using different shapes/fills for your j values. &lt;BR /&gt;&lt;BR /&gt;Data attribute maps are the way to do this &lt;A href="https://documentation.sas.com/?docsetId=grstatproc&amp;amp;docsetTarget=n18szqcwir8q2nn10od9hhdh2ksj.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=grstatproc&amp;amp;docsetTarget=n18szqcwir8q2nn10od9hhdh2ksj.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 23 Nov 2019 03:16:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Labels-in-SGPLOT/m-p/606650#M19155</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-23T03:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Labels in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Labels-in-SGPLOT/m-p/606764#M19156</link>
      <description>&lt;P&gt;If I interpret your request for #1 correctly, I think you should use a TEXT plot instead of a SCATTER plot. Use the variable from the SCATTER DATALABEL as both the TEXT variable and the GROUP variable, something like the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="x_language-sas"&gt;text x=x y=y text=j / group=j;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;'s suggestion for #2 is the best solution, and should work for any version of SAS supporting ODS Graphics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2019 04:12:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Labels-in-SGPLOT/m-p/606764#M19156</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-11-24T04:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Labels in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Labels-in-SGPLOT/m-p/607065#M19157</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/173881"&gt;@Junyong&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;In SGPLOT, DATALABEL or CURVELABEL can be used to write some contents inside.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot.png" style="width: 320px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34194iD7C038B36D2C05A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot.png" alt="SGPlot.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot1.png" style="width: 320px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34195iFBA035F1854344BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot1.png" alt="SGPlot1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I have two questions.&lt;/P&gt;
&lt;P&gt;1. When SGPLOT SCATTER, can I completely alter the symbols (dots, triangles, etc.) by their DATALABEL? In the attached example, I want to delete the symbols but want to alter them by the numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I am not sure exactly what you mean by "delete the symbols but want to alter them by the numbers". If you really mean that you only want to display the number value an no marker at all them perhaps you want a text plot:&lt;/P&gt;
&lt;PRE&gt;proc sgplot ;
text x=x y=y text=i /group=i;
run;
&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Nov 2019 17:11:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Labels-in-SGPLOT/m-p/607065#M19157</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-25T17:11:53Z</dc:date>
    </item>
  </channel>
</rss>

