<?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: Putting text in outer margin in GTL in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Putting-text-in-outer-margin-in-GTL/m-p/577559#M18579</link>
    <description>Perfect, thanks</description>
    <pubDate>Mon, 29 Jul 2019 22:10:04 GMT</pubDate>
    <dc:creator>plf515</dc:creator>
    <dc:date>2019-07-29T22:10:04Z</dc:date>
    <item>
      <title>Putting text in outer margin in GTL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Putting-text-in-outer-margin-in-GTL/m-p/577243#M18570</link>
      <description>&lt;P&gt;I am using SAS 9.4 on Windows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am making a set of scatter plots using PROC TEMPLATE.&amp;nbsp; Each plot has two lines -- one for the results of quantile regression and one for the result of OLS regression.&amp;nbsp; I would like to take the labels for the graph out of the individual plots and put them in a margin. Right now they clutter the plots, are hard to read and are redundant.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, get the data:&lt;/P&gt;&lt;PRE&gt;data quantreg.anscombe;
infile datalines firstobs=5;
input @1 X1 4.1 @9 y1 4.2    @18 X2 4.1 @26 Y2 4.2
      @34 X3 4.1 @41 y3 4.2  @48 x4 4.1 @57 Y4 4.2; 
datalines;
I   II  III     IV
x1       y1        x2       y2    x3      y3      x4       y4
         1         2         3         4         5         6
1234567890123456789012345678901234567890123456789012345678901234567890
10.0     8.04    10.0    9.14    10.0    7.46    8.0     6.58
 8.0     6.95     8.0    8.14     8.0    6.77    8.0     5.76
13.0     7.58    13.0    8.74    13.0   12.74    8.0     7.71
 9.0     8.81     9.0    8.77     9.0    7.11    8.0     8.84
11.0     8.33    11.0    9.26    11.0    7.81    8.0     8.47
14.0     9.96    14.0    8.10    14.0    8.84    8.0     7.04
 6.0     7.24     6.0    6.13     6.0    6.08    8.0     5.25
 4.0     4.26     4.0    3.10     4.0    5.39   19.0    12.50
12.0    10.84    12.0    9.13    12.0    8.15    8.0     5.56
 7.0     4.82     7.0    7.26     7.0    6.42    8.0     7.91
 5.0     5.68     5.0    4.74     5.0    5.73    8.0     6.89 
;&lt;/PRE&gt;&lt;P&gt;then get the regressions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc glm data = quantreg.anscombe;
  model y1 = x1;
run;
quit;

proc quantreg data = quantreg.anscombe;
 model y1 = x1;
run;

proc glm data = quantreg.anscombe;
  model y2 = x1;
run;
quit;

proc quantreg data = quantreg.anscombe;
 model y2 = x1;
run;

proc glm data = quantreg.anscombe;
  model y3 = x1;
run;
quit;

proc quantreg data = quantreg.anscombe;
 model y3 = x1;
run;

proc glm data = quantreg.anscombe;
  model y4 = x1;
run;
quit;

proc quantreg data = quantreg.anscombe;
 model y4 = x1;
run;

&lt;/PRE&gt;&lt;P&gt;finally, the part I am puzzled about, the plot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc template;
define statgraph ScatPlots;
begingraph;
layout lattice / rows=2 columns=2;
layout overlay;
  scatterplot x = x1 y = y1;
  lineparm x = 0 y = 3.000090909 slope = 0.500090909/curvelabel = "OLS fit";
  lineparm x = 0 y = 3.24 slope = 0.48/curvelabel = "Quantreg for median" lineattrs = (color = red) curvelabelattrs = (color = red) curvelabelposition = MIN;
endlayout;
layout overlay;
  scatterplot x = x1 y = y2;
  lineparm x = 0 y = 3.000909091 slope = 0.5/curvelabel = "OLS fit";
  lineparm x = 0 y = 3.13 slope = 0.5/curvelabel = "Quantreg for median" lineattrs = (color = red) curvelabelattrs = (color = red) curvelabelposition = MIN;
endlayout;
layout overlay;
  scatterplot x = x1 y = y3;
  lineparm x = 0 y = 3.002454545 slope = 0.5/curvelabel = "OLS fit";
  lineparm x = 0 y = 4.01 slope = 0.345/curvelabel = "Quantreg for median" lineattrs = (color = red) curvelabelattrs = (color = red) curvelabelposition = MIN;
endlayout;
layout overlay;
  scatterplot x = x1 y = y4;
  lineparm x = 0 y = 9.231363636 slope = -0.192272727/curvelabel = "OLS fit";
  lineparm x = 0 y = 6.8067 slope = 0.0167/curvelabel = "Quantreg for median" lineattrs = (color = red) curvelabelattrs = (color = red) curvelabelposition = MIN;
endlayout;
endlayout;
endgraph;
end;
run;

proc sgrender data=quantreg.anscombe template=ScatPlots;
run;&lt;/PRE&gt;&lt;P&gt;You can see that each plot has two big bits of text. I'd like to put all those in a margin and remove them from the four plots.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2019 17:25:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Putting-text-in-outer-margin-in-GTL/m-p/577243#M18570</guid>
      <dc:creator>plf515</dc:creator>
      <dc:date>2019-07-28T17:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Putting text in outer margin in GTL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Putting-text-in-outer-margin-in-GTL/m-p/577345#M18572</link>
      <description>&lt;P&gt;Would a LEGEND in a SIDEBAR be adequate?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
   define statgraph ScatPlots;
      begingraph;
         layout lattice / rows=2 columns=2;
            sidebar / align=bottom;
               layout gridded / border=true ;
                  discretelegend "OLS" "Median" / across=2;
                  endlayout;
               endsidebar;
            layout overlay;
               scatterplot x = x1 y = y1;
               lineparm x = 0 y = 3.000090909 slope = 0.500090909/ legendlabel = "OLS fit" name="OLS";
               lineparm x = 0 y = 3.24 slope = 0.48/ legendlabel = "Quantreg for median" lineattrs = (color = red) curvelabelattrs = (color = red) curvelabelposition = MIN name="Median";
               endlayout;
            layout overlay;
               scatterplot x = x1 y = y2;
               lineparm x = 0 y = 3.000909091 slope = 0.5/;
               lineparm x = 0 y = 3.13 slope = 0.5/ lineattrs=(color = red);
               endlayout;
            layout overlay;
               scatterplot x = x1 y = y3;
               lineparm x = 0 y = 3.002454545 slope = 0.5;
               lineparm x = 0 y = 4.01 slope = 0.345/ lineattrs=(color = red);
               endlayout;
            layout overlay;
               scatterplot x = x1 y = y4;
               lineparm x = 0 y = 9.231363636 slope = -0.192272727/;
               lineparm x = 0 y = 6.8067 slope = 0.0167/ lineattrs=(color = red);
               endlayout;
            endlayout;
         endgraph;
      end;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 13:51:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Putting-text-in-outer-margin-in-GTL/m-p/577345#M18572</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2019-07-29T13:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Putting text in outer margin in GTL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Putting-text-in-outer-margin-in-GTL/m-p/577559#M18579</link>
      <description>Perfect, thanks</description>
      <pubDate>Mon, 29 Jul 2019 22:10:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Putting-text-in-outer-margin-in-GTL/m-p/577559#M18579</guid>
      <dc:creator>plf515</dc:creator>
      <dc:date>2019-07-29T22:10:04Z</dc:date>
    </item>
  </channel>
</rss>

