<?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: Can we create a separate legend for each panel in PROC SGPANEL in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Can-we-create-a-separate-legend-for-each-panel-in-PROC-SGPANEL/m-p/610273#M19215</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/213624"&gt;@bkanumuri&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming a subject (subject) has one result (result) per timepoint (time) and belong to one of the arms (trt_group), you can try this:&lt;/P&gt;
&lt;P&gt;Each group will have one specific color (through the keylegend statement). The subject id will be displayed on each curve (curvelabel option). Does that answer you question?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=one;
   title 'Study Results by Treatment Group';
   series x=time y=results / group=subject grouplc=trt_group name='grouping' curvelabel;
   keylegend 'grouping' / type=linecolor;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 08 Dec 2019 09:31:00 GMT</pubDate>
    <dc:creator>ed_sas_member</dc:creator>
    <dc:date>2019-12-08T09:31:00Z</dc:date>
    <item>
      <title>Can we create a separate legend for each panel in PROC SGPANEL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Can-we-create-a-separate-legend-for-each-panel-in-PROC-SGPANEL/m-p/610271#M19214</link>
      <description>&lt;P&gt;I am trying to create spaghetti plots by treatment groups using PROC SGPANEL with each treatment group as one panel (side by side.)&lt;/P&gt;&lt;P&gt;I am able to get that but it creates 1 legend with all the subjects (subjects from both the treatment groups). Is there a way to create a separate legend one for each panel listing the subjects in the respective panel/treatment group?&lt;/P&gt;</description>
      <pubDate>Sun, 08 Dec 2019 09:09:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Can-we-create-a-separate-legend-for-each-panel-in-PROC-SGPANEL/m-p/610271#M19214</guid>
      <dc:creator>bkanumuri</dc:creator>
      <dc:date>2019-12-08T09:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a separate legend for each panel in PROC SGPANEL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Can-we-create-a-separate-legend-for-each-panel-in-PROC-SGPANEL/m-p/610273#M19215</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/213624"&gt;@bkanumuri&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming a subject (subject) has one result (result) per timepoint (time) and belong to one of the arms (trt_group), you can try this:&lt;/P&gt;
&lt;P&gt;Each group will have one specific color (through the keylegend statement). The subject id will be displayed on each curve (curvelabel option). Does that answer you question?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=one;
   title 'Study Results by Treatment Group';
   series x=time y=results / group=subject grouplc=trt_group name='grouping' curvelabel;
   keylegend 'grouping' / type=linecolor;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Dec 2019 09:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Can-we-create-a-separate-legend-for-each-panel-in-PROC-SGPANEL/m-p/610273#M19215</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-08T09:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a separate legend for each panel in PROC SGPANEL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Can-we-create-a-separate-legend-for-each-panel-in-PROC-SGPANEL/m-p/611354#M19222</link>
      <description>&lt;P&gt;I do not know how to create separate legends inside each cell in PROC SGPANEL. However, you can use PROC SGPLOT with a BY statement and then use ODS LAYOUT GRIDDED statement to arrange the plots into a panel. See&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2015/11/23/ods-statement-options-to-change/" target="_self"&gt;"Using the ODS statement to add layers in your ODS sandwich"&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2015/12/02/matrices-graphs-gridded-layout.html" target="_self"&gt;"Arrange matrices and graphs in a gridded layout"&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 15:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Can-we-create-a-separate-legend-for-each-panel-in-PROC-SGPANEL/m-p/611354#M19222</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-12-12T15:37:17Z</dc:date>
    </item>
  </channel>
</rss>

