<?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 SGPLOT position of Y axis label in relation to XAXISTABLE in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-position-of-Y-axis-label-in-relation-to-XAXISTABLE/m-p/270221#M9652</link>
    <description>&lt;P&gt;SAS 9.4 (TS1M3) sun unix&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=&amp;amp;plotdata;                                                                       
   series x=avisitn y=median / markers group=&amp;amp;trt groupdisplay=cluster name='legend';             
   highlow x=avisitn high=q3 low=q1 / group=&amp;amp;trt groupdisplay=cluster lowcap=serif highcap=serif; 
   xaxistable n / class=&amp;amp;trt;                                                                     
   keylegend 'legend' / autoitemsize location=inside  TITLE=" ";                                  
   xaxis values=(&amp;amp;visitlist);                                                                     
   label avisitn='Week' &amp;amp;trt=' ';                                                                 
   format &amp;amp;trt xtrt. avisitn avisitn.;                                                            
   run;                                                                                           
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and the relevant&amp;nbsp;part of the figure where you will notice that the long XAXISTABLE row labels appear&amp;nbsp;to be influencing the location of the of the Y axis label. &amp;nbsp;I would like the Y axis label to move closer to the Y axis tick labels. &amp;nbsp;Can I do that?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3157i2CE2E65090A7AB47/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 12 May 2016 21:59:52 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2016-05-12T21:59:52Z</dc:date>
    <item>
      <title>SGPLOT position of Y axis label in relation to XAXISTABLE</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-position-of-Y-axis-label-in-relation-to-XAXISTABLE/m-p/270221#M9652</link>
      <description>&lt;P&gt;SAS 9.4 (TS1M3) sun unix&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=&amp;amp;plotdata;                                                                       
   series x=avisitn y=median / markers group=&amp;amp;trt groupdisplay=cluster name='legend';             
   highlow x=avisitn high=q3 low=q1 / group=&amp;amp;trt groupdisplay=cluster lowcap=serif highcap=serif; 
   xaxistable n / class=&amp;amp;trt;                                                                     
   keylegend 'legend' / autoitemsize location=inside  TITLE=" ";                                  
   xaxis values=(&amp;amp;visitlist);                                                                     
   label avisitn='Week' &amp;amp;trt=' ';                                                                 
   format &amp;amp;trt xtrt. avisitn avisitn.;                                                            
   run;                                                                                           
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and the relevant&amp;nbsp;part of the figure where you will notice that the long XAXISTABLE row labels appear&amp;nbsp;to be influencing the location of the of the Y axis label. &amp;nbsp;I would like the Y axis label to move closer to the Y axis tick labels. &amp;nbsp;Can I do that?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3157i2CE2E65090A7AB47/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 21:59:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-position-of-Y-axis-label-in-relation-to-XAXISTABLE/m-p/270221#M9652</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-05-12T21:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT position of Y axis label in relation to XAXISTABLE</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-position-of-Y-axis-label-in-relation-to-XAXISTABLE/m-p/270345#M9653</link>
      <description>&lt;P&gt;I used SGANNO to annotate the label in the position I wanted it. &amp;nbsp;It is a bit fiddly because I have Y values on different figures with different number of digits in the Y axis tick labels. &amp;nbsp;Some have 2 some 4 so I have to adjust the X1 percent. &amp;nbsp;The code goes like this mostly copied from usage note sample program.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   data &amp;amp;sganno;
      if 0 then set &amp;amp;data(keep=&amp;amp;var);
      set &amp;amp;m._yrange(keep=ywidth);
      retain function 'text' x1space 'wallpercent' y1space 'datapercent'
             rotate 90 anchor "center" width 64;* textweight 'bold';
      length label $64;
      label=vlabel(&amp;amp;var);
      select(ywidth);
         when(2)   x1=-4.5;
         when(4)   x1=-6.5;
         otherwise x1=-5.5;
         end;
      y1=50;
      output;
      stop;
      run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Also add&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;yaxis display=(nolabel)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;to the SGPLOT&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2016 14:01:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-position-of-Y-axis-label-in-relation-to-XAXISTABLE/m-p/270345#M9653</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-05-13T14:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT position of Y axis label in relation to XAXISTABLE</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-position-of-Y-axis-label-in-relation-to-XAXISTABLE/m-p/270366#M9654</link>
      <description>&lt;P&gt;I too have encountered this case. &amp;nbsp;Using SGPLOT with OUTER axis table that has long class labels pushes the Y axis label out. &amp;nbsp;This is due to the internal uniform settings in the LAYOUT LATTICE that SGPLOT uses to layout the plots.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two ways to avoid this besides using Annotate. &amp;nbsp;One is to place the Subjects table INSIDE the graph using SGPLOT. &amp;nbsp;The other us to use GTL, suppress the Yaxis label, and draw your own using DRAWTEXT. &amp;nbsp;This is similar to Annotate, but a little more determinate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*--Define templage for Survival Plot--*/
proc template;
  define statgraph Fig_8_7_Survival_plot_out;
    begingraph  / axislineextent=data;
      entrytitle 'Product-Limit Survival Estimates';
      entrytitle 'With Number of AML Subjects at Risk' / textattrs=(size=8);
      layout lattice / columns=1 columndatarange=union rowweights=preferred rowgutter=10px;
        layout overlay / walldisplay=none
                       xaxisopts=(labelattrs=(size=8) tickvalueattrs=(size=7))
                       yaxisopts=(labelattrs=(size=8) tickvalueattrs=(size=7) display=(ticks tickvalues line));
          stepplot x=time y=survival / group=stratum name='s';
          scatterplot x=time y=censored / markerattrs=(symbol=plus) name='c';
          scatterplot x=time y=censored / markerattrs=(symbol=plus) GROUP=stratum;
	  discretelegend 'c' / location=inside halign=right valign=top valueattrs=(size=7);
          discretelegend 's' / valueattrs=(size=7);

	  /*--Draw the Y axis label closer to the axis--*/
	  drawtext textattrs=(size=8) 'Survival Probability' / x=-6 y=50 anchor=bottom 
                   xspace=wallpercent yspace=wallpercent rotate=90 width=50;
        endlayout;

        layout overlay / walldisplay=none xaxisopts=(display=none);
	  /*--Subjects at risk--*/
          axistable x=tatrisk value=atrisk / class=stratum colorgroup=stratum
                     labelattrs=(size=7) valueattrs=(size=7)
                     title='Subjects At Risk' titleattrs=(size=7);
	endlayout;

      endlayout;
    endgraph;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 May 2016 15:02:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-position-of-Y-axis-label-in-relation-to-XAXISTABLE/m-p/270366#M9654</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2016-05-13T15:02:37Z</dc:date>
    </item>
  </channel>
</rss>

