<?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 Separate Merged legends for each of the panels in a multi panel plot using SAS GTL in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Separate-Merged-legends-for-each-of-the-panels-in-a-multi-panel/m-p/601552#M19068</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a 2 panel plot with each of the panels displaying different data. However when I'm unable to create a separate merged legend for each of the panels with the treatment information within each of the panels. I was hoping that I could receive some help in doing so.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did try to use sidebar/ merged legend after each of the overlay, but it doesnt seem to work well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;proc template;&lt;BR /&gt;define statgraph line;&lt;BR /&gt;&lt;BR /&gt;begingraph / designwidth=12.5 in designheight=6in ;&lt;BR /&gt;entrytitle ' ';&lt;BR /&gt;layout lattice /rowdatarange=union rows=1 columns=2 columnweights=(0.50 0.50) rowweights=(1);&lt;BR /&gt;*--------------------------------------------------------------------*&lt;BR /&gt;| Left Line Plot&lt;BR /&gt;*--------------------------------------------------------------------*;&lt;BR /&gt;layout overlay / yaxisopts=(label="&amp;amp;ylabelu" linearopts=(viewmin=&amp;amp;yminu viewmax=&amp;amp;ymaxu tickvaluelist=(&amp;amp;yvalsu)))&lt;BR /&gt;xaxisopts=( label="&amp;amp;xlabelu"&lt;BR /&gt;linearopts=(viewmin=0 viewmax=&amp;amp;xamax tickvaluesequence=(start=0 end=&amp;amp;xend increment=&amp;amp;xint)));&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;scatterplot x=&amp;amp;xvar y=&amp;amp;stat.u/ group=treat name='treat' markerattrs=(size=5pt);&lt;BR /&gt;seriesplot x=&amp;amp;xvar y=&amp;amp;stat.u /group=treat name='treatl' lineattrs=(thickness=1 );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;endlayout;&lt;BR /&gt;&lt;BR /&gt;*--------------------------------------------------------------------*&lt;BR /&gt;| Right Line Plot&lt;BR /&gt;*--------------------------------------------------------------------*;&lt;/P&gt;&lt;P&gt;layout overlay / yaxisopts=(label="&amp;amp;ylabell" linearopts=(viewmin=&amp;amp;yminl viewmax=&amp;amp;ymaxl tickvaluelist=(&amp;amp;yvalsl)))&lt;BR /&gt;xaxisopts=( label="&amp;amp;xlabell"&lt;BR /&gt;linearopts=(viewmin=0 viewmax=&amp;amp;xamax /*tickvaluelist=(&amp;amp;xvals)*/ tickvaluesequence=(start=0 end=&amp;amp;xend increment=&amp;amp;xint)));&lt;/P&gt;&lt;P&gt;scatterplot x=&amp;amp;xvar y=&amp;amp;stat.l/ group=treat name='treatl' markerattrs=(size=5pt);&lt;BR /&gt;seriesplot x=&amp;amp;xvar y=&amp;amp;stat.l /group=treat name='treatl' lineattrs=(thickness=1 );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;endlayout;&lt;/P&gt;&lt;P&gt;sidebar / align=bottom;&lt;BR /&gt;mergedlegend "treat" "treatl" / border=off valueattrs=(size=8.75pt) order=rowmajor;&lt;BR /&gt;endsidebar;&lt;BR /&gt;endlayout;&lt;/P&gt;&lt;P&gt;endgraph;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ods _all_ close;&lt;BR /&gt;ods proclabel=' ';&lt;/P&gt;&lt;P&gt;ods rtf file="&amp;amp;foutput/&amp;amp;outputname..rtf" style=mystyle nogfootnote nogtitle bodytitle toc_data headery=720 footery=720;&lt;BR /&gt;ods pdf file="&amp;amp;foutput/&amp;amp;outputname..pdf" style=mystyle;&lt;BR /&gt;proc sgrender data=final template=line ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Nov 2019 00:58:41 GMT</pubDate>
    <dc:creator>DinoPut</dc:creator>
    <dc:date>2019-11-05T00:58:41Z</dc:date>
    <item>
      <title>Separate Merged legends for each of the panels in a multi panel plot using SAS GTL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Separate-Merged-legends-for-each-of-the-panels-in-a-multi-panel/m-p/601552#M19068</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a 2 panel plot with each of the panels displaying different data. However when I'm unable to create a separate merged legend for each of the panels with the treatment information within each of the panels. I was hoping that I could receive some help in doing so.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did try to use sidebar/ merged legend after each of the overlay, but it doesnt seem to work well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;proc template;&lt;BR /&gt;define statgraph line;&lt;BR /&gt;&lt;BR /&gt;begingraph / designwidth=12.5 in designheight=6in ;&lt;BR /&gt;entrytitle ' ';&lt;BR /&gt;layout lattice /rowdatarange=union rows=1 columns=2 columnweights=(0.50 0.50) rowweights=(1);&lt;BR /&gt;*--------------------------------------------------------------------*&lt;BR /&gt;| Left Line Plot&lt;BR /&gt;*--------------------------------------------------------------------*;&lt;BR /&gt;layout overlay / yaxisopts=(label="&amp;amp;ylabelu" linearopts=(viewmin=&amp;amp;yminu viewmax=&amp;amp;ymaxu tickvaluelist=(&amp;amp;yvalsu)))&lt;BR /&gt;xaxisopts=( label="&amp;amp;xlabelu"&lt;BR /&gt;linearopts=(viewmin=0 viewmax=&amp;amp;xamax tickvaluesequence=(start=0 end=&amp;amp;xend increment=&amp;amp;xint)));&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;scatterplot x=&amp;amp;xvar y=&amp;amp;stat.u/ group=treat name='treat' markerattrs=(size=5pt);&lt;BR /&gt;seriesplot x=&amp;amp;xvar y=&amp;amp;stat.u /group=treat name='treatl' lineattrs=(thickness=1 );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;endlayout;&lt;BR /&gt;&lt;BR /&gt;*--------------------------------------------------------------------*&lt;BR /&gt;| Right Line Plot&lt;BR /&gt;*--------------------------------------------------------------------*;&lt;/P&gt;&lt;P&gt;layout overlay / yaxisopts=(label="&amp;amp;ylabell" linearopts=(viewmin=&amp;amp;yminl viewmax=&amp;amp;ymaxl tickvaluelist=(&amp;amp;yvalsl)))&lt;BR /&gt;xaxisopts=( label="&amp;amp;xlabell"&lt;BR /&gt;linearopts=(viewmin=0 viewmax=&amp;amp;xamax /*tickvaluelist=(&amp;amp;xvals)*/ tickvaluesequence=(start=0 end=&amp;amp;xend increment=&amp;amp;xint)));&lt;/P&gt;&lt;P&gt;scatterplot x=&amp;amp;xvar y=&amp;amp;stat.l/ group=treat name='treatl' markerattrs=(size=5pt);&lt;BR /&gt;seriesplot x=&amp;amp;xvar y=&amp;amp;stat.l /group=treat name='treatl' lineattrs=(thickness=1 );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;endlayout;&lt;/P&gt;&lt;P&gt;sidebar / align=bottom;&lt;BR /&gt;mergedlegend "treat" "treatl" / border=off valueattrs=(size=8.75pt) order=rowmajor;&lt;BR /&gt;endsidebar;&lt;BR /&gt;endlayout;&lt;/P&gt;&lt;P&gt;endgraph;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ods _all_ close;&lt;BR /&gt;ods proclabel=' ';&lt;/P&gt;&lt;P&gt;ods rtf file="&amp;amp;foutput/&amp;amp;outputname..rtf" style=mystyle nogfootnote nogtitle bodytitle toc_data headery=720 footery=720;&lt;BR /&gt;ods pdf file="&amp;amp;foutput/&amp;amp;outputname..pdf" style=mystyle;&lt;BR /&gt;proc sgrender data=final template=line ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 00:58:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Separate-Merged-legends-for-each-of-the-panels-in-a-multi-panel/m-p/601552#M19068</guid>
      <dc:creator>DinoPut</dc:creator>
      <dc:date>2019-11-05T00:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Merged legends for each of the panels in a multi panel plot using SAS GTL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Separate-Merged-legends-for-each-of-the-panels-in-a-multi-panel/m-p/601558#M19069</link>
      <description>&lt;P&gt;In this case, there is no advantage to using separate SCATTERPLOT and SERIESPLOT statements. Try doing the following:&lt;/P&gt;
&lt;P&gt;1. Move your MARKERATTRS options to the SERIESPLOT statements&lt;/P&gt;
&lt;P&gt;2. Add DISPLAY=(markers) to the SERIESPLOT statements&lt;/P&gt;
&lt;P&gt;3. Remove the SCATTERPLOT statements&lt;/P&gt;
&lt;P&gt;4. Make sure the NAMEs on the SERIESPLOT statement are unique.&lt;/P&gt;
&lt;P&gt;5. Change MERGELEGEND to DISCRETELEGEND and make sure the names match the names on the SERIESPLOT statements.&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>Tue, 05 Nov 2019 02:48:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Separate-Merged-legends-for-each-of-the-panels-in-a-multi-panel/m-p/601558#M19069</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-11-05T02:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Merged legends for each of the panels in a multi panel plot using SAS GTL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Separate-Merged-legends-for-each-of-the-panels-in-a-multi-panel/m-p/602783#M19085</link>
      <description>Thank you for your response, Dan! Discretelegend could be used to display legends in both panels. Could mergedlegend be used in any way? I don't think globallegend would work either</description>
      <pubDate>Fri, 08 Nov 2019 17:23:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Separate-Merged-legends-for-each-of-the-panels-in-a-multi-panel/m-p/602783#M19085</guid>
      <dc:creator>DinoPut</dc:creator>
      <dc:date>2019-11-08T17:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Merged legends for each of the panels in a multi panel plot using SAS GTL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Separate-Merged-legends-for-each-of-the-panels-in-a-multi-panel/m-p/602806#M19086</link>
      <description>&lt;P&gt;Oh, you want a legend in each panel. There are couple of ways to do this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Using your ORIGINAL code, make the NAMEs on each of your series and scatter plot unique. Then, put a MERGELEGEND inside each LAYOUT OVERLAY, referencing the correct plot names in your cell.&lt;/P&gt;
&lt;P&gt;2. You could do the steps in my previous post, and put DISCRETELEGENDs in each cell. referencing the correct series plot..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Be sure to remove the SIDEBAR in either case. Also, GLOBALLEGEND could be used, but I think you'll get better alignment with #1 or #2 above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;BR /&gt;Dan&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 18:44:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Separate-Merged-legends-for-each-of-the-panels-in-a-multi-panel/m-p/602806#M19086</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-11-08T18:44:57Z</dc:date>
    </item>
  </channel>
</rss>

