<?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: How to display one legend for multiple plots with SGPLOT in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-display-one-legend-for-multiple-plots-with-SGPLOT/m-p/538581#M22439</link>
    <description>&lt;P&gt;I tried using the same code with sgpanel. It worked for my toy case, but when I applied it to my real use case (with three scatter plots and two series plots per group),&amp;nbsp;only one&amp;nbsp;marker per plot was displayed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;</description>
    <pubDate>Tue, 26 Feb 2019 07:41:04 GMT</pubDate>
    <dc:creator>happy_mouth</dc:creator>
    <dc:date>2019-02-26T07:41:04Z</dc:date>
    <item>
      <title>How to display one legend for multiple plots with SGPLOT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-display-one-legend-for-multiple-plots-with-SGPLOT/m-p/537900#M22420</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering how to display&amp;nbsp;a single legend &amp;nbsp;for multiple plots when using &lt;STRONG&gt;ods layout gridded&lt;/STRONG&gt; with &lt;STRONG&gt;proc sgplot&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, as the code and graphic below show, I'm using &lt;STRONG&gt;keylegend &lt;/STRONG&gt;which produces one legend for each plot. How can I display that same legend only once, below the title?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ods powerpoint file="/u1/reporting_happy/testinggraphs.pptx" nogfootnote dpi=300 style=styles.mystyle;
/*Rows =8 forces A SECOND GRID PAGE*/
title1  "This is the title of the dummy slide" height=20pt;

ods graphics on / width=2.725in height=1.1in scale=on;
ods layout gridded columns=3 rows=8 advance=bygroup COLUMN_GUTTER=3pt ;
ods region;


	/*for each variablename */
	proc sgplot data=AllMVariables uniform=group noautolegend noborder pad=0 nocycleattrs;
		by variablename;
		scatter x=macvalue y=measurey / group=measure name="measure" grouporder=reversedata;
		keylegend "measure" / BORDER POSITION=top;
 	series x=macvalue y=measurey / group = measure name="measure" grouporder=ascending attrid=myid 
		lineattrs=(pattern=solid thickness=1) GROUPDISPLAY=CLUSTER clusterwidth=0.0;
		xaxis display=none;
		yaxis display=none;
		options nobyline;
		title "#byval1" ls=1.5 height=12pt;
	run;

ods layout end;
ods powerpoint close;
quit;
;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS Results Graph3.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27365i8E47BACF7CA24D6C/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS Results Graph3.PNG" alt="SAS Results Graph3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 22:18:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-display-one-legend-for-multiple-plots-with-SGPLOT/m-p/537900#M22420</guid>
      <dc:creator>happy_mouth</dc:creator>
      <dc:date>2019-02-22T22:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to display one legend for multiple plots with SGPLOT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-display-one-legend-for-multiple-plots-with-SGPLOT/m-p/537935#M22421</link>
      <description>&lt;P&gt;Is there a reason why you can't move this to SGPANEL?&lt;/P&gt;</description>
      <pubDate>Sat, 23 Feb 2019 05:01:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-display-one-legend-for-multiple-plots-with-SGPLOT/m-p/537935#M22421</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-02-23T05:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to display one legend for multiple plots with SGPLOT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-display-one-legend-for-multiple-plots-with-SGPLOT/m-p/538581#M22439</link>
      <description>&lt;P&gt;I tried using the same code with sgpanel. It worked for my toy case, but when I applied it to my real use case (with three scatter plots and two series plots per group),&amp;nbsp;only one&amp;nbsp;marker per plot was displayed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 07:41:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-display-one-legend-for-multiple-plots-with-SGPLOT/m-p/538581#M22439</guid>
      <dc:creator>happy_mouth</dc:creator>
      <dc:date>2019-02-26T07:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to display one legend for multiple plots with SGPLOT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-display-one-legend-for-multiple-plots-with-SGPLOT/m-p/538712#M22445</link>
      <description>&lt;P&gt;But sgpanel &lt;EM&gt;should&lt;/EM&gt; work and would be the way to go. Sgpanel can draw many plots, each involving many groups, in every graph cell of a panel.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 16:58:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-display-one-legend-for-multiple-plots-with-SGPLOT/m-p/538712#M22445</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-02-26T16:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to display one legend for multiple plots with SGPLOT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-display-one-legend-for-multiple-plots-with-SGPLOT/m-p/538849#M22446</link>
      <description>&lt;P&gt;Hi PG,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your replies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try using SGPANEL, I get the legend outside the rest of the plot, as I want, thanks,&amp;nbsp;but there is a problem with the X-axis scaling in some of the subplots. The scale of the axis seems to be set by something other than then the minimum and maximum values of the group (maybe the max\min of the column???). (See code and result below.) Scaling works fine&amp;nbsp;with SGPLOT; is there a way to control the scaling in SGPANEL so the x-axis range is determined by min and max values in each cell?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Important part of code:&lt;/P&gt;&lt;PRE&gt;ods powerpoint file="/u1/pretendpath/testinggraphs.pptx" nogfootnote dpi=300 style=styles.mystyle;
/*Rows =8 forces A SECOND GRID PAGE*/
title  "This is the title of the dummy slide" height=20pt;

ods graphics on / width=8.8in height=4.87in scale=on;

proc sgpanel data=AllMVariables dattrmap=scenarioattrs noautolegend pad=0 nocycleattrs;
	panelby variablename /  layout=panel columns=3 rows=4 novarname uniscale=row;
	colaxis display=none;
	rowaxis display=none;

 	series x=macvalue y=measure / group = measure name="measure" grouporder=ascending attrid=myid 
		lineattrs=(pattern=solid thickness=1) GROUPDISPLAY=CLUSTER clusterwidth=0.0;
 	series x=macvalue y=measure / group = measure name="measure" grouporder=ascending attrid=myid 
		lineattrs=(pattern=solid thickness=7) GROUPDISPLAY=CLUSTER clusterwidth=0.0;

	scatter x=macvalue y=measure / group=measure name="measure" grouporder=ascending attrid=myid 
		 filledoutlinedmarkers markerattrs=(symbol=CircleFilled size=15) GROUPDISPLAY=CLUSTER clusterwidth=0.0;
		keylegend "measure" / BORDER POSITION=top;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS Results Graph4.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27515iC0A59082E32F1BEB/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS Results Graph4.PNG" alt="SAS Results Graph4.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 23:15:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-display-one-legend-for-multiple-plots-with-SGPLOT/m-p/538849#M22446</guid>
      <dc:creator>happy_mouth</dc:creator>
      <dc:date>2019-02-26T23:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to display one legend for multiple plots with SGPLOT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-display-one-legend-for-multiple-plots-with-SGPLOT/m-p/538877#M22447</link>
      <description>&lt;P&gt;Looking at your example, it looks like option UNISCALE=ROW in the PANELBY statement might do the trick.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 04:01:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-display-one-legend-for-multiple-plots-with-SGPLOT/m-p/538877#M22447</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-02-27T04:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to display one legend for multiple plots with SGPLOT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-display-one-legend-for-multiple-plots-with-SGPLOT/m-p/539476#M22462</link>
      <description>&lt;P&gt;Thanks for your help, PG.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I contacted tech support and they suggested that I manually create a title with legend information, like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title2&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;box&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;c&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=cxFAC090 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;h&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;20&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;pt &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"(*ESC*){unicode '25cf'x}"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;h&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;12&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;pt &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;c&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=black &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'&amp;nbsp;Boston '&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;c&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=cx4F6228 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;h&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;20&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;pt &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"(*ESC*){unicode '25cf'x}"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;h&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;12&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;pt &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;c&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=black &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'&amp;nbsp;Denver '&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;c&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=cx1F497D &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;h&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;20&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;pt &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"(*ESC*){unicode '25cf'x}"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;h&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;12&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;pt &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;c&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=black &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' Seattle&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;This works OK with SGPLOT,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;Thanks again.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 20:22:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-display-one-legend-for-multiple-plots-with-SGPLOT/m-p/539476#M22462</guid>
      <dc:creator>happy_mouth</dc:creator>
      <dc:date>2019-02-28T20:22:53Z</dc:date>
    </item>
  </channel>
</rss>

