<?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 Modifying space between forestplot data in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Modifying-space-between-forestplot-data/m-p/816437#M22893</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been trying to create a simple forest plot in SAS for my data. The ouptput looks good in my result viewer but its resolution is not great. I have tried severally to save it a picture format directly into my system but the space between the individual plots gets wider and the picture looks distorted. I have tried so many adjustments to the code such as changing the design height, the offsetmin and max but did not work.&lt;/P&gt;
&lt;P&gt;I will appreciate your help. Also adding a label "higher mortality risk" and "lower mortality risk" did not work so I ran only the proc template to generate the result attached&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AS shown in my SAS result viewer" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71993i9DEBC3196684EB17/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGRender3.png" alt="AS shown in my SAS result viewer" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;AS shown in my SAS result viewer&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="When i save on my PC using ODS listing" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71994i262D5075D77C36AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="FIGURE4A1.png" alt="When i save on my PC using ODS listing" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;When i save on my PC using ODS listing&lt;/span&gt;&lt;/span&gt;/************************************************************/
proc format;
  value unicodeLabel
    1 = "(*ESC*){unicode '2190'x} Lower mortality risk -"
    2 = "- Higher mortality risk (*ESC*){unicode '2192'x}"
  ; 
run;

data bottomLabel;
  attrib textLeft format=unicodeLabel.
          textRight format=unicodeLabel.;
  labXLeft = 0.9; labXRight= 1.1; labY = 27; textLeft = 1; textRight = 2;
  output;
run;

data forestfinal;
  merge tcr.forest bottomLabel;
run;
/******************did not work******************************************/
proc template;
define statgraph forestAxisTable;
dynamic _bandColor _headerColor _subGroupcolor;
begingraph / designheight= 1.0in designwidth = 1.0in;

discreteattrmap name='text' / trimleading=true;
value '1' / textAttrs=(color=blue size=5 weight=bold);
value '2' / textAttrs=(color=blue size=5 weight=normal);
enddiscreteattrmap;

discreteattrvar attrvar=txtDAV var=id attrmap='text';

layout lattice / columns=1;

/*--Column headers--*/
sidebar / align=top;
layout lattice / columns=3 rowweights=uniform columnweights = (0.3 0.42 0.28)
backgroundcolor=_headerColor opaque=true;
entry textAttrs=(size=8 weight=bold) hAlign=left "Subgroup"
hAlign=right "Hazard Ratio (95% CI)";
entry textAttrs=(size=8 weight=bold) " ";

entry textAttrs=(size=8 weight=bold) hAlign=right "P-value";
endLayout;
endsidebar;

/* Single cell with inner margins for left and right tables */
layout overlay / xAxisOpts=(display=(line ticks tickvalues)
tickValueAttrs=(size=6 weight=bold)
labelAttrs=(size=6 weight=bold)
linearOpts=(tickValuePriority=true
tickValueList=(0.0 0.5 1.0 1.5 2.0))
offsetMin=0.3 OFFSETMAX=0.5)
yAxisOpts=(reverse=true display=none) wallDisplay=none;

/* Left-side table */
innerMargin / align=left gutter=0.3in;
axisTable y=obsId value=SUBGROUP / textGroup=txtDAV
indentWeight=indentwt display=(values);
axisTable y=obsId value=GROUP / display=(values);
endInnerMargin;

/* Hazard Ratio plot */
referenceLine y=ref / lineAttrs=(pattern=solid thickness=15 color = white);
scatterPlot y=obsId x=mean / markerAttrs=(symbol=diamondFilled color = blue) 
xErrorLower=LOW xErrorUpper=HIGH errorBarCapShape=none;
referenceLine x=1;

 /* better indicator */
textPlot y=labY x=labXLeft text=textLeft / strip=true
position=left contributeOffsets=(yMin);
textPlot y=labY x=labXRight text=textRight / strip=true
position=right contributeOffsets=(yMin);

/* Right-side table */
innerMargin / align=right;
%let commonRightTableOpts = display=(values) showMissing=false
labelAttrs=(size=7 weight=bold);
/*axisTable y=obsId value=PCIGroup / &amp;amp;commonRightTableOpts;*/
axisTable y=obsId value=p_value  /  &amp;amp;commonRightTableOpts;
/**axisTable y=obsId value=p_value / &amp;amp;commonRightTableOpts
pad=(left=9%) display=(values);**/
endInnerMargin;
        

endLayout; /* overlay */
endLayout; /* lattice */
endgraph;
end;
run;
ods listing image_dpi=200;
ods graphics / reset width=7.5in height=4.5in imagename='FIGURE4A';

proc sgrender data=tcr.forest2 template=forestAxisTable;
  dynamic _bandcolor='white' _headercolor='';
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jun 2022 20:41:45 GMT</pubDate>
    <dc:creator>Banke</dc:creator>
    <dc:date>2022-06-03T20:41:45Z</dc:date>
    <item>
      <title>Modifying space between forestplot data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Modifying-space-between-forestplot-data/m-p/816437#M22893</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been trying to create a simple forest plot in SAS for my data. The ouptput looks good in my result viewer but its resolution is not great. I have tried severally to save it a picture format directly into my system but the space between the individual plots gets wider and the picture looks distorted. I have tried so many adjustments to the code such as changing the design height, the offsetmin and max but did not work.&lt;/P&gt;
&lt;P&gt;I will appreciate your help. Also adding a label "higher mortality risk" and "lower mortality risk" did not work so I ran only the proc template to generate the result attached&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AS shown in my SAS result viewer" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71993i9DEBC3196684EB17/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGRender3.png" alt="AS shown in my SAS result viewer" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;AS shown in my SAS result viewer&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="When i save on my PC using ODS listing" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71994i262D5075D77C36AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="FIGURE4A1.png" alt="When i save on my PC using ODS listing" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;When i save on my PC using ODS listing&lt;/span&gt;&lt;/span&gt;/************************************************************/
proc format;
  value unicodeLabel
    1 = "(*ESC*){unicode '2190'x} Lower mortality risk -"
    2 = "- Higher mortality risk (*ESC*){unicode '2192'x}"
  ; 
run;

data bottomLabel;
  attrib textLeft format=unicodeLabel.
          textRight format=unicodeLabel.;
  labXLeft = 0.9; labXRight= 1.1; labY = 27; textLeft = 1; textRight = 2;
  output;
run;

data forestfinal;
  merge tcr.forest bottomLabel;
run;
/******************did not work******************************************/
proc template;
define statgraph forestAxisTable;
dynamic _bandColor _headerColor _subGroupcolor;
begingraph / designheight= 1.0in designwidth = 1.0in;

discreteattrmap name='text' / trimleading=true;
value '1' / textAttrs=(color=blue size=5 weight=bold);
value '2' / textAttrs=(color=blue size=5 weight=normal);
enddiscreteattrmap;

discreteattrvar attrvar=txtDAV var=id attrmap='text';

layout lattice / columns=1;

/*--Column headers--*/
sidebar / align=top;
layout lattice / columns=3 rowweights=uniform columnweights = (0.3 0.42 0.28)
backgroundcolor=_headerColor opaque=true;
entry textAttrs=(size=8 weight=bold) hAlign=left "Subgroup"
hAlign=right "Hazard Ratio (95% CI)";
entry textAttrs=(size=8 weight=bold) " ";

entry textAttrs=(size=8 weight=bold) hAlign=right "P-value";
endLayout;
endsidebar;

/* Single cell with inner margins for left and right tables */
layout overlay / xAxisOpts=(display=(line ticks tickvalues)
tickValueAttrs=(size=6 weight=bold)
labelAttrs=(size=6 weight=bold)
linearOpts=(tickValuePriority=true
tickValueList=(0.0 0.5 1.0 1.5 2.0))
offsetMin=0.3 OFFSETMAX=0.5)
yAxisOpts=(reverse=true display=none) wallDisplay=none;

/* Left-side table */
innerMargin / align=left gutter=0.3in;
axisTable y=obsId value=SUBGROUP / textGroup=txtDAV
indentWeight=indentwt display=(values);
axisTable y=obsId value=GROUP / display=(values);
endInnerMargin;

/* Hazard Ratio plot */
referenceLine y=ref / lineAttrs=(pattern=solid thickness=15 color = white);
scatterPlot y=obsId x=mean / markerAttrs=(symbol=diamondFilled color = blue) 
xErrorLower=LOW xErrorUpper=HIGH errorBarCapShape=none;
referenceLine x=1;

 /* better indicator */
textPlot y=labY x=labXLeft text=textLeft / strip=true
position=left contributeOffsets=(yMin);
textPlot y=labY x=labXRight text=textRight / strip=true
position=right contributeOffsets=(yMin);

/* Right-side table */
innerMargin / align=right;
%let commonRightTableOpts = display=(values) showMissing=false
labelAttrs=(size=7 weight=bold);
/*axisTable y=obsId value=PCIGroup / &amp;amp;commonRightTableOpts;*/
axisTable y=obsId value=p_value  /  &amp;amp;commonRightTableOpts;
/**axisTable y=obsId value=p_value / &amp;amp;commonRightTableOpts
pad=(left=9%) display=(values);**/
endInnerMargin;
        

endLayout; /* overlay */
endLayout; /* lattice */
endgraph;
end;
run;
ods listing image_dpi=200;
ods graphics / reset width=7.5in height=4.5in imagename='FIGURE4A';

proc sgrender data=tcr.forest2 template=forestAxisTable;
  dynamic _bandcolor='white' _headercolor='';
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 20:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Modifying-space-between-forestplot-data/m-p/816437#M22893</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2022-06-03T20:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying space between forestplot data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Modifying-space-between-forestplot-data/m-p/816513#M22894</link>
      <description>&lt;P&gt;I have moved this topic to 'Graphics Programming' board.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is indeed visual analytics ( or visual analysis strictly speaking )&lt;/P&gt;
&lt;P&gt;, but it has nothing to do with the SAS product Visual Analytics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jun 2022 21:27:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Modifying-space-between-forestplot-data/m-p/816513#M22894</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-06-04T21:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying space between forestplot data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Modifying-space-between-forestplot-data/m-p/816516#M22895</link>
      <description>&lt;P&gt;Thank you very much for the clarification&lt;span class="lia-unicode-emoji" title=":see_no_evil_monkey:"&gt;🙈&lt;/span&gt; and for moving it to the right section&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jun 2022 00:50:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Modifying-space-between-forestplot-data/m-p/816516#M22895</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2022-06-05T00:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying space between forestplot data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Modifying-space-between-forestplot-data/m-p/816916#M22906</link>
      <description>&lt;P&gt;Are you running the code in SAS Studio, Enterprise Guide, DMS SAS, other?&lt;/P&gt;
&lt;P&gt;Per the 'resolution', have you tried increasing where you're using image_dpi=200 ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 18:16:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Modifying-space-between-forestplot-data/m-p/816916#M22906</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2022-06-07T18:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying space between forestplot data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Modifying-space-between-forestplot-data/m-p/816942#M22907</link>
      <description>&lt;P&gt;I'm running the program on SAS 9.4 windows. I tried modifying the resolution and size, but it was still the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 19:22:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Modifying-space-between-forestplot-data/m-p/816942#M22907</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2022-06-07T19:22:43Z</dc:date>
    </item>
  </channel>
</rss>

