<?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: Proc Sgplot Yaxistable label position in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-Yaxistable-label-position/m-p/472412#M16321</link>
    <description>&lt;P&gt;Furthermore I wonder if I can use the group option in the HBAR statement WITHOUT affecting the YAXISTABLE. If I do so, and in this case having 2 levels in the group, I get twice the number of columns as it is split by group.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jun 2018 09:06:03 GMT</pubDate>
    <dc:creator>acordes</dc:creator>
    <dc:date>2018-06-22T09:06:03Z</dc:date>
    <item>
      <title>Proc Sgplot Yaxistable label position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-Yaxistable-label-position/m-p/472302#M16315</link>
      <description>I'm writing on my Android hence cannot insert the code.&lt;BR /&gt;My plot combines Hbar statement and a yaxistable and it does so satisfactory.&lt;BR /&gt;But I cannot manage to get the labels from the axistable to the top.&lt;BR /&gt;I suppose that due to lack of space it gets moved to the bottom whatever I try. The Labelpos option doesn't fix the problem either.&lt;BR /&gt;Any idea?</description>
      <pubDate>Thu, 21 Jun 2018 21:51:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-Yaxistable-label-position/m-p/472302#M16315</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2018-06-21T21:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sgplot Yaxistable label position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-Yaxistable-label-position/m-p/472323#M16316</link>
      <description>&lt;P&gt;It is easier to help if you post your code with sample data.&amp;nbsp; Also SAS version.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 22:55:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-Yaxistable-label-position/m-p/472323#M16316</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2018-06-21T22:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sgplot Yaxistable label position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-Yaxistable-label-position/m-p/472411#M16320</link>
      <description>&lt;P&gt;For sure.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks to the SAS Jedi trick&amp;nbsp;The DATA to DATA Step Macro&amp;nbsp;&lt;A title="data to data step macro" href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/&lt;/A&gt;&amp;nbsp;I can generate the data set:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WORK.TRY;
  INFILE DATALINES DSD TRUNCOVER;
  INPUT DIFF:PERCENT9.2 PERC:PERCENT9. M:32. V:32. MAX:32. MIN:32. DIFFPLUS:32. DIFFNEG:32. MV:32. MM:32. OBS:32. NAME:$57. COMP:$22.;
DATALINES4;
(  1.63%),34%,0.5953204496,0.6116648155,0.6116648155,0.5953204496,-0.016344366,,641,482,1,L1,V_WINS
0.04%,19%,0.6064239733,0.6060735665,0.6064239733,0.6060735665,,0.0003504068,359,256,2,L2,M_WINS
(  0.31%),16%,0.5932613868,0.5963613685,0.5963613685,0.5932613868,-0.003099982,,275,266,3,I3,V_WINS
1.91%,16%,0.5729693443,0.5538312623,0.5729693443,0.5538312623,,0.019138082,332,190,4,I4,M_WINS
1.61%,7%,0.5588098603,0.5427254229,0.5588098603,0.5427254229,,0.0160844374,204,22,5,T5,M_WINS
(  4.92%),4%,0.5404668375,0.5897045724,0.5897045724,0.5404668375,-0.049237735,,55,84,6,A6,V_WINS
1.41%,1%,0.7134496412,0.6993465515,0.7134496412,0.6993465515,,0.0141030897,6,20,7,A7,M_WINS
(  5.41%),1%,0.5602382022,0.6143416111,0.6143416111,0.5602382022,-0.054103409,,3,20,8,M8,V_WINS
4.05%,1%,0.6105264617,0.5699828477,0.6105264617,0.5699828477,,0.0405436141,2,20,9,L9,M_WINS
(  0.95%),1%,0.6177154876,0.6272112139,0.6272112139,0.6177154876,-0.009495726,,2,20,10,L10,V_WINS
0.00%,1%,0.6787155622,,0.6787155622,0.6787155622,,0,,20,11,A11,M_WINS
0.00%,0%,,0.62606918,0.62606918,0.62606918,,0,12,,12,L12,V_WINS
0.00%,0%,,0.6433033764,0.6433033764,0.6433033764,,0,9,,13,L13,V_WINS
0.00%,0%,,0.6073440585,0.6073440585,0.6073440585,,0,6,,14,L14,V_WINS
0.00%,0%,,0.6612735808,0.6612735808,0.6612735808,,0,1,,15,L15,V_WINS
;;;;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC FORMAT;
   PICTURE POSITIVER 
     LOW-&amp;lt;0='000,000.00,0%'
     0&amp;lt;-HIGH='000,000.00,0%';
RUN;

title "Comparison" ;
PROC SGPLOT DATA=WORK.TRY  ;
FORMAT  DIFF: POSITIVER. M V PERCENT9.2;
LABEL PERC="% DE LA MUESTRA" MM="#BRAND" MV="#BANK"; 

/*HBAR NAME / RESPONSE=DIFF GROUP=COMP*/
/*TRANSPARENCY=0 DATASKIN=SHEEN  */
/*LEGENDLABEL="DIFFERENCE BETWEEN DATA SOURCES" NAME="DIFS";*/

HBAR NAME / RESPONSE=DIFFPLUS 
TRANSPARENCY=0 DATASKIN=SHEEN FILLATTRS=(COLOR=LIGHTBLUE) 
LEGENDLABEL="BANK PERFORMS BETTER" NAME="DIFS";

HBAR NAME / RESPONSE=DIFFNEG 
TRANSPARENCY=0 DATASKIN=SHEEN FILLATTRS=(COLOR=GRGY) 
LEGENDLABEL="BRAND PERFORMS BETTER" NAME="DIFS1";

YAXISTABLE PERC M MM V MV  / LABELATTRS=(SIZE=8PT)  
VALUEATTRS=(SIZE=8PT COLOR=STBG ) LABELPOS=TOP LABELJUSTIFY=LEFT    ;

KEYLEGEND "DIFS" "DIFS1"       / ACROSS=2  ;  
XAXIS DISPLAY=(NOLABEL) VALUES=(-0.06 TO 0.06 BY 0.01) GRID;
YAXIS DISPLAY=(NOLABEL) DISCRETEORDER=DATA GRID GRIDATTRS=(COLOR=GRAY THICKNESS=0.1 PATTERN=35);

RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ODS.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21328iDF74619B03D0C6DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="ODS.png" alt="ODS.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to move the labels to the TOP. Furthermore I'd like to control and unify the column width of the YAXISTABLE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I don't know how to convert the percentage range towards the left to negative.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;bye, Arne&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 08:56:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-Yaxistable-label-position/m-p/472411#M16320</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2018-06-22T08:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sgplot Yaxistable label position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-Yaxistable-label-position/m-p/472412#M16321</link>
      <description>&lt;P&gt;Furthermore I wonder if I can use the group option in the HBAR statement WITHOUT affecting the YAXISTABLE. If I do so, and in this case having 2 levels in the group, I get twice the number of columns as it is split by group.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 09:06:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-Yaxistable-label-position/m-p/472412#M16321</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2018-06-22T09:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sgplot Yaxistable label position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-Yaxistable-label-position/m-p/473258#M16358</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13856"&gt;@Jay54&lt;/a&gt;&amp;nbsp;, I think that I've delivered code and example &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;
&lt;P&gt;I'm running EG version 7.13&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 08:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-Yaxistable-label-position/m-p/473258#M16358</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2018-06-26T08:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sgplot Yaxistable label position</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-Yaxistable-label-position/m-p/473967#M16361</link>
      <description>&lt;P&gt;To make the the percentages on the left show as negative numbers, you can&amp;nbsp; use VALUESDISPLAY= option on the XAXIS statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I read the &lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2018/01/09/need-know-graph-template-data-object-proc-sgplot/" target="_blank"&gt;What you need to know about the graph template and data object in PROC SGPLOT&lt;/A&gt; blog post by Warren Kuhfeld.&amp;nbsp; &amp;nbsp;I added the TMPLOUT= option on the PROC SGPLOT statement, and used the ODS OUTPUT statement to write the data object to a SAS data set.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data object shows the values in the same order as your TRY data set.&amp;nbsp; In the graph template, I see that labelposition=max.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you only do one HBAR statement with the axis table, the labels show up at the top, and the graph template shows labelposition=min.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's some interaction when you do two HBAR statements with the axis table, and then labelposition=max in the graph template, which means the labels are at the bottom.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can force the labels to the top by using LABELPOS=BOTTOM.&amp;nbsp; That seems backwards, but perhaps Sanjay can provide a better method to get what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know how to control the column widths of the y axis table.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Updated code is below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics / height=11in;

title "Comparison" ;
PROC SGPLOT DATA=WORK.TRY tmplout='/folders/myfolders/ODS Graphics/tmpl';
  ods output sgplot=dataobject;
FORMAT  DIFF: POSITIVER. M V PERCENT9.2;
LABEL PERC="% DE LA MUESTRA" MM="#BRAND" MV="#BANK"; 

HBAR NAME / RESPONSE=DIFFNEG 
TRANSPARENCY=0 DATASKIN=SHEEN FILLATTRS=(COLOR=GRGY) 
LEGENDLABEL="BRAND PERFORMS BETTER" NAME="DIFS1";

HBAR NAME / RESPONSE=DIFFPLUS 
TRANSPARENCY=0 DATASKIN=SHEEN FILLATTRS=(COLOR=LIGHTBLUE) 
LEGENDLABEL="BANK PERFORMS BETTER" NAME="DIFS";

YAXISTABLE PERC M MM V MV  / LABELATTRS=(SIZE=8PT)  
VALUEATTRS=(SIZE=8PT COLOR=STBG ) LABELPOS=bottom LABELJUSTIFY=LEFT    ;

KEYLEGEND "DIFS" "DIFS1"       / ACROSS=2  ;  
XAXIS DISPLAY=(NOLABEL) VALUES=(-0.06 TO 0.06 BY 0.01) GRID
     valuesdisplay=('-6,0%' '-5,0%' '-4,0%' '-3,0%' '-2,0%' '-1,0%' ''
                    '1,0%' '2,0%' '3,0%' '4,0%' '5,0%' '6,0%');
YAXIS DISPLAY=(NOLABEL) DISCRETEORDER=DATA GRID GRIDATTRS=(COLOR=GRAY THICKNESS=0.1 PATTERN=35);

RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The graphic is below.&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="PROC SGPLOT with two HBAR plots and a YAXISTABLE statement" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21461i444F703B9DBD6184/image-size/large?v=v2&amp;amp;px=999" role="button" title="PROC SGPLOT with two HBAR plots and YAXISTABLE.jpg" alt="PROC SGPLOT with two HBAR plots and a YAXISTABLE statement" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;PROC SGPLOT with two HBAR plots and a YAXISTABLE statement&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 04:10:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-Yaxistable-label-position/m-p/473967#M16361</guid>
      <dc:creator>SuzanneDorinski</dc:creator>
      <dc:date>2018-06-28T04:10:19Z</dc:date>
    </item>
  </channel>
</rss>

