<?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 x-axis not aligning in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-x-axis-not-aligning/m-p/687376#M20522</link>
    <description>&lt;P&gt;Yes, that worked, Thanks !&lt;/P&gt;&lt;P&gt;Was also thinking about creating a different Month Variable, one that for any month_year combination, would return the 15th (middle) of the respective month.&amp;nbsp; But your solution is much better, thanks !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 01:30:58 GMT</pubDate>
    <dc:creator>rmacarthur</dc:creator>
    <dc:date>2020-09-29T01:30:58Z</dc:date>
    <item>
      <title>PROC SGPLOT x-axis not aligning</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-x-axis-not-aligning/m-p/687059#M20520</link>
      <description>&lt;P&gt;Hello SAS Friends,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am using SAS ver 9.4 and ODS graphics to create a stacked bar graph, output to a .ppt file.&lt;/P&gt;&lt;P&gt;Cannot fathom why the bars are not aligned with the x-axis text (months) and Tick Marks, note especially AUGUST and FEBRUARY are very misaligned.&lt;/P&gt;&lt;P&gt;There should be one bar per month, and each should align with the month name and tick marker.&lt;/P&gt;&lt;P&gt;The graph and dataset are attached.&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title h=7 j=c " Number of New Products Reported in Shortage in 2020 by Month";
%let datetime 		= 	%sysfunc(compress(%sysfunc(today(),yymmddN8.)_%sysfunc(time(),hhmm6.), ': '));
ods powerpoint file="&amp;amp;out\Graphs_1 &amp;amp;datetime..ppt" nogtitle nogfootnote;
ods graphics / width=8.0in height=8.0in; 
ods layout gridded columns=1; 
 ods region; 
proc sort	data	=	CP.DS_4_20		;	by	_Initial_Posting_Date_yr	_Initial_Posting_Date_mo	;	run	;	
 proc sgplot data=CP.DS_4_20		;
 	styleattrs datacolors=(palegreen lightblue);
	vbar _Initial_Posting_Date_mo /  response=count group=IV_n
	              datalabel datalabelattrs=(size=8.5pt)
                  seglabel /*seglabelformat=4.*/ seglabelattrs=(size=8.5pt);
xaxis display=all  LABELPOS=CENTER	LABEL="Month"	type=time ;
yaxis display=all	values=(0 to 300 by 25)LABELPOS=CENTER	LABEL="No. Products";
keylegend / 		title="" 		/*location=inside*/ 	position=bottom noborder;
format count 4.0	_Initial_Posting_Date_mo	monname3.;
run;
ods layout end; 
ods powerpoint close;

ODS _ALL_ CLOSE ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Had to provide the .PPT file as a .PDF file , so could be uploaded here.&lt;/P&gt;&lt;P&gt;Any and all suggestions are welcomed,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Sep 2020 19:45:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-x-axis-not-aligning/m-p/687059#M20520</guid>
      <dc:creator>rmacarthur</dc:creator>
      <dc:date>2020-09-27T19:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT x-axis not aligning</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-x-axis-not-aligning/m-p/687162#M20521</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/28361"&gt;@rmacarthur&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you need &lt;FONT face="courier new,courier"&gt;type=&lt;STRONG&gt;discrete&lt;/STRONG&gt;&lt;/FONT&gt; in the XAXIS statement rather than &lt;FONT face="courier new,courier"&gt;type=time&lt;/FONT&gt;. The latter uses the actual date values of variable&amp;nbsp;&lt;FONT face="courier new,courier"&gt;_Initial_Posting_Date_mo&lt;/FONT&gt;, hence the variation (of the bar positions) between months. The &lt;FONT face="courier new,courier"&gt;discrete&lt;/FONT&gt; axis type should work for your sample data in conjunction with the &lt;FONT face="courier new,courier"&gt;monname3.&lt;/FONT&gt; format because all date values are from the same year.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:14:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-x-axis-not-aligning/m-p/687162#M20521</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-09-28T10:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT x-axis not aligning</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-x-axis-not-aligning/m-p/687376#M20522</link>
      <description>&lt;P&gt;Yes, that worked, Thanks !&lt;/P&gt;&lt;P&gt;Was also thinking about creating a different Month Variable, one that for any month_year combination, would return the 15th (middle) of the respective month.&amp;nbsp; But your solution is much better, thanks !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 01:30:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-x-axis-not-aligning/m-p/687376#M20522</guid>
      <dc:creator>rmacarthur</dc:creator>
      <dc:date>2020-09-29T01:30:58Z</dc:date>
    </item>
  </channel>
</rss>

