<?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: sgscatter legend and axis values in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/sgscatter-legend-and-axis-values/m-p/248662#M9022</link>
    <description>&lt;P&gt;Hi Sophia, instead of using SGSCATTER, you can use the Lattice Layout in GTL to obtain a scatterplot containing more than one cell, and the REGRESSIONPLOT, SCATTERPLOT and MODELBAND statements can produce your regression line with the various fits. You can then produce your legend with the DISCRETELEGEND statement which gives you more options. Also you can edit the x-axis with the XAXISOPTS options.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is example code that you can use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
   define statgraph scattertemp;
      begingraph;
	     layout lattice / columns = 2;
	        layout overlay / xaxisopts = (linearopts=(viewmin=0 viewmax = 8000));
		       modelband "myclm";
		       modelband "mycli" / outlineattrs=GraphPredictionLimits display=(outline);
		       scatterplot x=weight y=mpg_highway;
		       regressionplot x=weight y=mpg_highway / clm = "myclm" cli = "mycli" name = "regleg" 
                 legendlabel = "Fit and Confidence Limits";
		   endlayout;
		   layout overlay;
		      modelband "myclm2";
		      modelband "mycli2" /outlineattrs=GraphPredictionLimits display=(outline);
              scatterplot x=horsepower y=msrp;
		      regressionplot x=horsepower y=msrp /clm = "myclm2" cli = "mycli2";
		   endlayout;
		   sidebar / align=bottom;
		      discretelegend "regleg" / border=off;
		   endsidebar;
      endlayout;
	endgraph;
  end;
run;

proc sgrender data = sashelp.cars template = scattertemp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12271iC386DABF3A910127/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="SGRender.png" title="SGRender.png" /&gt;</description>
    <pubDate>Mon, 08 Feb 2016 14:36:11 GMT</pubDate>
    <dc:creator>djrisks</dc:creator>
    <dc:date>2016-02-08T14:36:11Z</dc:date>
    <item>
      <title>sgscatter legend and axis values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgscatter-legend-and-axis-values/m-p/214309#M7984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using sgscatter and have two questions about controlling the output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. On the output, I would like to include a legend that includes 'fit' and prediction/confidence limits. It would be akin to the legendlabel="Fit" option in sgplot.&amp;nbsp; &lt;/P&gt;&lt;P&gt;2. Is there a good work around to altering my xaxis value?&amp;nbsp; I would like to control these for a couple of my plots, but am unsure of how to do so in sgscatter plot.&amp;nbsp; Is it even possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the basic structure for my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgscatter data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; plot a1*b1&amp;nbsp; a2*b2 /&amp;nbsp; reg =(clm cli) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 14:30:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgscatter-legend-and-axis-values/m-p/214309#M7984</guid>
      <dc:creator>sophia_SAS</dc:creator>
      <dc:date>2015-04-01T14:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: sgscatter legend and axis values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgscatter-legend-and-axis-values/m-p/248662#M9022</link>
      <description>&lt;P&gt;Hi Sophia, instead of using SGSCATTER, you can use the Lattice Layout in GTL to obtain a scatterplot containing more than one cell, and the REGRESSIONPLOT, SCATTERPLOT and MODELBAND statements can produce your regression line with the various fits. You can then produce your legend with the DISCRETELEGEND statement which gives you more options. Also you can edit the x-axis with the XAXISOPTS options.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is example code that you can use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
   define statgraph scattertemp;
      begingraph;
	     layout lattice / columns = 2;
	        layout overlay / xaxisopts = (linearopts=(viewmin=0 viewmax = 8000));
		       modelband "myclm";
		       modelband "mycli" / outlineattrs=GraphPredictionLimits display=(outline);
		       scatterplot x=weight y=mpg_highway;
		       regressionplot x=weight y=mpg_highway / clm = "myclm" cli = "mycli" name = "regleg" 
                 legendlabel = "Fit and Confidence Limits";
		   endlayout;
		   layout overlay;
		      modelband "myclm2";
		      modelband "mycli2" /outlineattrs=GraphPredictionLimits display=(outline);
              scatterplot x=horsepower y=msrp;
		      regressionplot x=horsepower y=msrp /clm = "myclm2" cli = "mycli2";
		   endlayout;
		   sidebar / align=bottom;
		      discretelegend "regleg" / border=off;
		   endsidebar;
      endlayout;
	endgraph;
  end;
run;

proc sgrender data = sashelp.cars template = scattertemp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12271iC386DABF3A910127/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="SGRender.png" title="SGRender.png" /&gt;</description>
      <pubDate>Mon, 08 Feb 2016 14:36:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgscatter-legend-and-axis-values/m-p/248662#M9022</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2016-02-08T14:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: sgscatter legend and axis values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgscatter-legend-and-axis-values/m-p/248808#M9028</link>
      <description>&lt;P&gt;You can use the TMPLOUT="filename" option to get the GTL generated by the SGSCATTER procedure. &amp;nbsp;It will look similar to what Kris has proposed. &amp;nbsp;Then, you can add the options like LegendLabel, etc to customize the graph. &amp;nbsp;Or, try using the ODS Graphics Designer to create your GTL graph. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 04:31:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgscatter-legend-and-axis-values/m-p/248808#M9028</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2016-02-09T04:31:03Z</dc:date>
    </item>
  </channel>
</rss>

