<?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 get uniform spacing across pages for dot plot (scatter plot) ? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-get-uniform-spacing-across-pages-for-dot-plot-scatter/m-p/839553#M23223</link>
    <description>&lt;P&gt;What changes are you willing to make to the yaxis labels? Since the space is changing because of label length that would be a place to start.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2022 00:59:38 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-10-20T00:59:38Z</dc:date>
    <item>
      <title>How to get uniform spacing across pages for dot plot (scatter plot) ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-get-uniform-spacing-across-pages-for-dot-plot-scatter/m-p/839552#M23222</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have a dot plot with 3 pages and grouped data.&lt;/P&gt;&lt;P&gt;I want to get uniform spacing for all 3 pages with space as in Group 3 below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For ex. for Page 2, all 3 data lines should be at top with spacing of about 0.5 cm as in Group3.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any option to do this ?&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&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="Screenshot 2022-10-19 204019.png" style="width: 832px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76370i1D92882C34B8B817/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-10-19 204019.png" alt="Screenshot 2022-10-19 204019.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%let gpath='C:/';
%let dpi=200;
%let na=na;
%let nb=nb;

data ae;
  input Pref $1-30 NA NB SNA SNB;
datalines;
ABDOMINAL PAIN                20    61    216    431
ANOREXIA                       2    15    216    431
ARTHRALGIA                     1    15    216    431
BACK PAIN                     10    23    216    431
BRONCHITIS                     8    11    216    431
CHEST PAIN                     9    12    216    431
CHRONIC OBSTRUCTIVE AIRWAY    76    95    216    431
COUGHING                      13    26    216    431
DIARRHEA                      23    90    216    431
DIZZINESS                      9    29    216    431
DYSPEPSIA                      8    42    216    431
DYSPNEA                       15     9    216    431
FATIGUE                        4    16    216    431
FLATULENCE                     6    20    216    431
GASTROESOPHAGEAL REFLUX        5    12    216    431
HEADACHE                      14    36    216    431
HEMATURIA                      2    14    216    431
HYPERKALEMIA                   4     9    216    431
INFECTION VIRAL               12    26    216    431
INJURY                        12    30    216    431
INSOMNIA                       4    26    216    431
MELENA                         7    12    216    431
MYALGIA                        6    12    216    431
NAUSEA                        10    82    216    431
PAIN                           4    17    216    431
RASH                           4     9    216    431
RESPIRATORY DISORDER           4    11    216    431
RHINITIS                      11    17    216    431
SINUSITIS                     13    28    216    431
UPPER RESP TRACT INFECTION    33    68    216    431
URINARY TRACT INFECTION        6    12    216    431
VOMITING                       6    37    216    431
WEIGHT DECREASE                2     9    216
run;

/*--Compute Proportions for treatment A &amp;amp; B, Mean and Risk--*/
data ae_risk;
  set ae;
  keep pref a b mean lcl ucl;
  a=na/sna;
  b=nb/snb;
  factor=1.96*sqrt(a*(1-a)/sna + b*(1-b)/snb);
  lcl=a-b+factor;
  ucl=a-b-factor;
  mean=0.5*(lcl+ucl);
run;

/*--Sort by mean value--*/
proc sort data=ae_risk out=ae_sort;
  by mean;
run;

/*--Add alternate reference lines--*/
data ae_ref;
  set ae_sort;
  if mod(_n_, 2) eq 0 then ref=pref;
  if _n_ &amp;lt;=5 then group=1 ;
  else if _n_ &amp;lt;=8 then group=2;
  else group=3 ;
run;
proc print;run;
 
/*--Create template for AE graph--*/
proc template;
  define statgraph AEbyRelativeRisk;
    dynamic _thk _grid;
    begingraph;
      entrytitle 'Most Frequent On-Therapy Adverse Events Sorted by Risk Difference';
      layout lattice / columns=2 rowdatarange=union columngutter=5;
	  
        /*--Row block to get common external row axes--*/
	rowaxes;
	  rowaxis / griddisplay=_grid display=(tickvalues) tickvalueattrs=(size=5);
	endrowaxes;

	/*--Column headers with filled background--*/
	column2headers;
	  layout overlay / border=true backgroundcolor=cxdfdfdf opaque=true; 
            entry "Proportion"; 
          endlayout;
	  layout overlay / border=true backgroundcolor=cxdfdfdf opaque=true; 
            entry "Risk Difference with 0.95 CI"; 
          endlayout;
        endcolumn2headers;

	/*--Left side cell with proportional values--*/
        layout overlay / xaxisopts=(display=(ticks tickvalues)  tickvalueattrs=(size=7));
	      referenceline y=ref / lineattrs=(thickness=_thk) datatransparency=0.9;
          scatterplot y=pref x=a / markerattrs=graphdata2(symbol=circlefilled)
                        name='a' legendlabel="Treatment (N=&amp;amp;NA)";
	  scatterplot y=pref x=b / markerattrs=graphdata1(symbol=trianglefilled)
                        name='b' legendlabel="Control (N=&amp;amp;NB)";
	endlayout;

	/*--Right side cell with Relative Risk values--*/
	layout overlay / xaxisopts=(label='Less Risk                    More Risk'
                         labelattrs=(size=8)  tickvalueattrs=(size=7));
	  referenceline y=ref / lineattrs=(thickness=_thk) datatransparency=0.9;
          scatterplot y=pref x=mean / xerrorlower=lcl xerrorupper=ucl 
                      markerattrs=(symbol=circlefilled size=5);
	  referenceline x=0 / lineattrs=graphdatadefault(pattern=shortdash);
	endlayout;

	/*--Centered side bar for legend--*/
        sidebar / spacefill=false;
          discretelegend 'a' 'b' / border=false;
	endsidebar;
      endlayout;
    endgraph;
  end;
run;


ods html close;
ods listing gpath=&amp;amp;gpath image_dpi=&amp;amp;dpi style=listing;

/*--Render the graph with grid lines without horizontal bands--*/
ods graphics / reset width=6in height=4in imagename='AEbyRelativeRisk';
proc sgrender data=ae_ref template=AEbyRelativeRisk;
  dynamic _thk='0' _grid='on';
by group ;
run;

 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 00:45:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-get-uniform-spacing-across-pages-for-dot-plot-scatter/m-p/839552#M23222</guid>
      <dc:creator>Peter0123</dc:creator>
      <dc:date>2022-10-20T00:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to get uniform spacing across pages for dot plot (scatter plot) ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-get-uniform-spacing-across-pages-for-dot-plot-scatter/m-p/839553#M23223</link>
      <description>&lt;P&gt;What changes are you willing to make to the yaxis labels? Since the space is changing because of label length that would be a place to start.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 00:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-get-uniform-spacing-across-pages-for-dot-plot-scatter/m-p/839553#M23223</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-20T00:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get uniform spacing across pages for dot plot (scatter plot) ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-get-uniform-spacing-across-pages-for-dot-plot-scatter/m-p/839555#M23224</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Can change yaxis labels if display is correct.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I tried this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Group 3 has more number of obs (24) hence getting good space.&lt;/P&gt;&lt;P&gt;can something like this be done ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%macro graph; 
%do group =1 %to 3;
	data   ae_ref2 ;
	set   ae_ref;
	where group= &amp;amp;group  ;
	run;

title5 Group: &amp;amp;group ;
proc sgrender data=ae_ref2 template=AEbyRelativeRisk;
  dynamic _thk='0' _grid='on';
/*by group ;*/
run;

%end;

%mend graph;
%graph; 

&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 01:17:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-get-uniform-spacing-across-pages-for-dot-plot-scatter/m-p/839555#M23224</guid>
      <dc:creator>Peter0123</dc:creator>
      <dc:date>2022-10-20T01:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get uniform spacing across pages for dot plot (scatter plot) ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-get-uniform-spacing-across-pages-for-dot-plot-scatter/m-p/839558#M23225</link>
      <description>&lt;P&gt;One thing might be a custom format that displays closer to the same number of characters for each value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add one or more *, or other special character, in the value to break text using the ROWAXIS option TICKVALUESPLITCHAR.&lt;/P&gt;
&lt;P&gt;If the value of the text to display were "Something with*an asterisk" and the Rowaxis has Tickvaluesplitchar='*' the line would attempt to split into&lt;/P&gt;
&lt;P&gt;Something with&lt;/P&gt;
&lt;P&gt;an asterisk&lt;/P&gt;
&lt;P&gt;as the label for the tick mark.&lt;/P&gt;
&lt;P&gt;You can split one line of text multiple times but you may still have issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use a smaller font for the label values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 01:47:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-get-uniform-spacing-across-pages-for-dot-plot-scatter/m-p/839558#M23225</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-20T01:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get uniform spacing across pages for dot plot (scatter plot) ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-get-uniform-spacing-across-pages-for-dot-plot-scatter/m-p/839631#M23226</link>
      <description>&lt;P&gt;If this is a one-off kind of graphing situation, you can increase the OFFSETMIN on the ROWAXIS statement for each group run to achieve the same spacing between categories. &amp;nbsp;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 12:49:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-get-uniform-spacing-across-pages-for-dot-plot-scatter/m-p/839631#M23226</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2022-10-20T12:49:55Z</dc:date>
    </item>
  </channel>
</rss>

