<?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 do I add gridlines to xaxistable with sgplot? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-add-gridlines-to-xaxistable-with-sgplot/m-p/821653#M22945</link>
    <description>&lt;P&gt;I don't think there is an option to add a grid to an XAXISTABLE. I looked in the documentation for the XAXISTABLE statement and even looked at the AXISTABLE statement in the GTL. I do not see any options to draw a grid automatically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jul 2022 18:19:31 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2022-07-05T18:19:31Z</dc:date>
    <item>
      <title>How do I add gridlines to xaxistable with sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-add-gridlines-to-xaxistable-with-sgplot/m-p/821635#M22944</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my first time posting to the forum but I have found it incredibly helpful in my journey of learning SAS so I thought I would try posting a question I have. I found one similar question in the forum from a few years ago but there was no solution in the thread. I am using SAS 9.4 and am trying to create a clustered bar chart (using sgplot) with a table of values directly below. Using xaxistable, I am able to get the desired result with the exception of one small formatting issue: gridlines. I am not looking to add gridlines to the graph, but to the table below the graph. I inserted a sample dataset and code for what I am doing as well as pictures of the resulting graph and desired formatting changes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data sampledata;
input percent 4.1 gender $ group $;
datalines;
15.8 M 1
27.4 M 2
19.6 M 3
25.2 F 2
28.1 F 1
29.6 F 3
;
run;

proc sgplot data=sampledata;
vbar gender / group=group groupdisplay=cluster datalabel datalabelfitpolicy=none response=percent;
xaxis values=("M" "F") display=(nolabel) 
valuesdisplay=("Male" "Female") fitpolicy=splitalways;
styleattrs datacolors=(CXFBFFB3 CX68CAB5 CX4376B3);
styleattrs datacontrastcolors=(Black);
xaxistable percent/ pad=15;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AshleyS_0-1657035539482.png" style="width: 583px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72934iB8BD0E3619EC6EBE/image-dimensions/583x466?v=v2" width="583" height="466" role="button" title="AshleyS_0-1657035539482.png" alt="AshleyS_0-1657035539482.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AshleyS_1-1657035553924.png" style="width: 619px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72935iC0119A14FE944D42/image-dimensions/619x461?v=v2" width="619" height="461" role="button" title="AshleyS_1-1657035553924.png" alt="AshleyS_1-1657035553924.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 15:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-add-gridlines-to-xaxistable-with-sgplot/m-p/821635#M22944</guid>
      <dc:creator>AshleyS</dc:creator>
      <dc:date>2022-07-05T15:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add gridlines to xaxistable with sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-add-gridlines-to-xaxistable-with-sgplot/m-p/821653#M22945</link>
      <description>&lt;P&gt;I don't think there is an option to add a grid to an XAXISTABLE. I looked in the documentation for the XAXISTABLE statement and even looked at the AXISTABLE statement in the GTL. I do not see any options to draw a grid automatically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 18:19:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-add-gridlines-to-xaxistable-with-sgplot/m-p/821653#M22945</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-07-05T18:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add gridlines to xaxistable with sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-add-gridlines-to-xaxistable-with-sgplot/m-p/821691#M22946</link>
      <description>&lt;P&gt;Thank you for looking into this, Rick. It seems that adding gridlines to the XAXISTABLE statement may not be a feature that is currently available then.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 19:42:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-add-gridlines-to-xaxistable-with-sgplot/m-p/821691#M22946</guid>
      <dc:creator>AshleyS</dc:creator>
      <dc:date>2022-07-05T19:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add gridlines to xaxistable with sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-add-gridlines-to-xaxistable-with-sgplot/m-p/821696#M22947</link>
      <description>&lt;P&gt;Yes. That is my conclusion.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 19:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-add-gridlines-to-xaxistable-with-sgplot/m-p/821696#M22947</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-07-05T19:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add gridlines to xaxistable with sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-add-gridlines-to-xaxistable-with-sgplot/m-p/822435#M22951</link>
      <description>&lt;P&gt;You could use ODS layout and proc report to add the table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a quick and dirty solultion.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods layout gridded;
 
ods region style={bordercolor=black borderstyle=solid borderwidth=.25pt};

ods graphics / noborder;
proc sgplot data=sampledata;
vbar gender / group=group groupdisplay=cluster datalabel datalabelfitpolicy=none response=percent;
xaxis values=("M" "F") display=(nolabel) 
valuesdisplay=("Male" "Female") fitpolicy=splitalways;
styleattrs datacolors=(CXFBFFB3 CX68CAB5 CX4376B3);
styleattrs datacontrastcolors=(Black);
/* xaxistable percent/ pad=15; */
run;

proc report data=sampledata nowd;
columns  group percent,gender;
define group / group style=[cellwidth=2cm just=c];
define gender / across '' order=data style=[cellwidth=7cm just=c] ;
define percent / analysis '' style=[cellwidth=7cm just=c];
run;

ods layout end;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ghosh_0-1657382320789.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73099i1BE6A6CBDFBFBF71/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ghosh_0-1657382320789.png" alt="ghosh_0-1657382320789.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jul 2022 15:58:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-add-gridlines-to-xaxistable-with-sgplot/m-p/822435#M22951</guid>
      <dc:creator>ghosh</dc:creator>
      <dc:date>2022-07-09T15:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add gridlines to xaxistable with sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-add-gridlines-to-xaxistable-with-sgplot/m-p/822905#M22962</link>
      <description>Thank you so much, Ghosh!</description>
      <pubDate>Tue, 12 Jul 2022 17:08:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-add-gridlines-to-xaxistable-with-sgplot/m-p/822905#M22962</guid>
      <dc:creator>AshleyS</dc:creator>
      <dc:date>2022-07-12T17:08:44Z</dc:date>
    </item>
  </channel>
</rss>

