<?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: SGplot keylegend help in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SGplot-keylegend-help/m-p/915912#M24331</link>
    <description>&lt;P&gt;You need to use a secondary classifier on the SERIES plot, and tell the legend to show only the line color. Here is an example using the data from the other post:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
    input usubjid$ trta$ avisit$ aval;
    datalines;
    xx-01 A Day1 10
    xx-01 A Day5 11
    xx-02 A Day1  9
    xx-02 A Day5 10
    xx-03 B Day1 20
    xx-03 B Day5 17
    xx-04 B Day1 19
    xx-04 B Day5 21
    ;
run;
proc sgplot data=test;
    series x=avisit y=aval / group=usubjid grouplc=trta;
    keylegend / type=linecolor title="TRTA";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Feb 2024 19:41:36 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2024-02-13T19:41:36Z</dc:date>
    <item>
      <title>SGplot keylegend help</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGplot-keylegend-help/m-p/915906#M24329</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have similar situation in link below. my question is this is individual plot with many lines.&lt;/P&gt;&lt;P&gt;but for legend, i just want to specify the color by group.&lt;/P&gt;&lt;P&gt;for example, in&amp;nbsp;FreelanceReinh Jade's post:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sas"&gt;series x=avisit y=aval / group=usubjid attrid=myid;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;for legend, instead of list usubjids, just want to list legend as blue for&amp;nbsp;trta='A' and red for&amp;nbsp;trta='B'. how do i do that? thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Graphics-Programming/How-Can-I-Specify-Line-Colors-per-Group-in-SG-Plot/td-p/469547" target="_blank"&gt;Solved: How Can I Specify Line Colors per Group in SG Plot? - SAS Support Communities&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 19:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGplot-keylegend-help/m-p/915906#M24329</guid>
      <dc:creator>magicdj</dc:creator>
      <dc:date>2024-02-13T19:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: SGplot keylegend help</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGplot-keylegend-help/m-p/915912#M24331</link>
      <description>&lt;P&gt;You need to use a secondary classifier on the SERIES plot, and tell the legend to show only the line color. Here is an example using the data from the other post:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
    input usubjid$ trta$ avisit$ aval;
    datalines;
    xx-01 A Day1 10
    xx-01 A Day5 11
    xx-02 A Day1  9
    xx-02 A Day5 10
    xx-03 B Day1 20
    xx-03 B Day5 17
    xx-04 B Day1 19
    xx-04 B Day5 21
    ;
run;
proc sgplot data=test;
    series x=avisit y=aval / group=usubjid grouplc=trta;
    keylegend / type=linecolor title="TRTA";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 19:41:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGplot-keylegend-help/m-p/915912#M24331</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2024-02-13T19:41:36Z</dc:date>
    </item>
  </channel>
</rss>

