<?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 control label for the x-axis in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-control-label-for-the-x-axis/m-p/944600#M45251</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp; thanks very much for providing some useful tips. Noted. Correct, I did not include all vars thinking may not be needed. All is good.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2024 14:10:51 GMT</pubDate>
    <dc:creator>bijayadhikar</dc:creator>
    <dc:date>2024-09-19T14:10:51Z</dc:date>
    <item>
      <title>how to control label for the x-axis</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-control-label-for-the-x-axis/m-p/943952#M45231</link>
      <description>&lt;P&gt;I am trying to use &lt;CODE&gt;PROC SGPLOT&lt;/CODE&gt; with the following dataset. Currently with my script the x-axis goes from 1-52. I want the x-axis to start with week 35 and continue through week 52, then follow with weeks 1 to 34. Any assistance would be greatly appreciated.&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="bijayadhikar_0-1726320252779.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100361i77E3D060EB42AA06/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bijayadhikar_0-1726320252779.png" alt="bijayadhikar_0-1726320252779.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data original_data;&lt;BR /&gt;infile datalines dlm="," dsd;&lt;BR /&gt;input Surveillance_Week $ weekly_count_curryr rolling_avg_prevyr;&lt;BR /&gt;datalines;&lt;BR /&gt;35,15,7&lt;BR /&gt;36,11,5.7&lt;BR /&gt;37,,8.3&lt;BR /&gt;38,,9.7&lt;BR /&gt;39,,13.7&lt;BR /&gt;40,,15.3&lt;BR /&gt;41,,20&lt;BR /&gt;42,,24&lt;BR /&gt;43,,27&lt;BR /&gt;44,,27.7&lt;BR /&gt;45,,29.7&lt;BR /&gt;46,,32&lt;BR /&gt;47,,33&lt;BR /&gt;48,,30&lt;BR /&gt;49,,27.7&lt;BR /&gt;50,,24&lt;BR /&gt;51,,21&lt;BR /&gt;52,,15.3&lt;BR /&gt;53,,9.7&lt;BR /&gt;01,,13.7&lt;BR /&gt;02,,20&lt;BR /&gt;03,,18&lt;BR /&gt;04,,17&lt;BR /&gt;05,,14.3&lt;BR /&gt;06,,15.7&lt;BR /&gt;07,,14.7&lt;BR /&gt;08,,12.3&lt;BR /&gt;09,,10.7&lt;BR /&gt;10,,9.3&lt;BR /&gt;11,,11&lt;BR /&gt;12,,10.7&lt;BR /&gt;13,,10.3&lt;BR /&gt;14,,10.7&lt;BR /&gt;15,,11.3&lt;BR /&gt;16,,13.3&lt;BR /&gt;17,,13&lt;BR /&gt;18,,12.3&lt;BR /&gt;19,,9.7&lt;BR /&gt;20,,7.7&lt;BR /&gt;21,,7.3&lt;BR /&gt;22,,8.7&lt;BR /&gt;23,,7.3&lt;BR /&gt;24,,9&lt;BR /&gt;25,,8.7&lt;BR /&gt;26,,11.7&lt;BR /&gt;27,,10&lt;BR /&gt;28,,7.7&lt;BR /&gt;29,,5.3&lt;BR /&gt;30,,4.3&lt;BR /&gt;31,,6&lt;BR /&gt;32,,8.3&lt;BR /&gt;33,,7.3&lt;BR /&gt;34,,5.3&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc sgplot data=comb_adjusted;&lt;BR /&gt;where serial_num &amp;gt;= 3;&lt;BR /&gt;vbar adjusted_week / response=weekly_count_curryr &lt;BR /&gt;datalabel &lt;BR /&gt;barwidth=0.8 &lt;BR /&gt;fillattrs=(color=green);&lt;BR /&gt;vline adjusted_week / response=rolling_avg_prevyr &lt;BR /&gt;lineattrs=(color=blue thickness=3);&lt;BR /&gt;xaxis label="Surveillance Week"; /* No grid option here removes vertical lines */&lt;BR /&gt;yaxis label="count" grid; /* Keeps horizontal grid lines */&lt;BR /&gt;keylegend / position=topright across=1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Sep 2024 13:26:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-control-label-for-the-x-axis/m-p/943952#M45231</guid>
      <dc:creator>bijayadhikar</dc:creator>
      <dc:date>2024-09-14T13:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to control label for the x-axis</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-control-label-for-the-x-axis/m-p/943961#M45232</link>
      <description>&lt;P&gt;You'd better post a desired graphic to let me know what you are looking for .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data original_data;
infile datalines dlm="," dsd;
input Surveillance_Week $ weekly_count_curryr rolling_avg_prevyr;
datalines;
35,15,7
36,11,5.7
37,,8.3
38,,9.7
39,,13.7
40,,15.3
41,,20
42,,24
43,,27
44,,27.7
45,,29.7
46,,32
47,,33
48,,30
49,,27.7
50,,24
51,,21
52,,15.3
53,,9.7
01,,13.7
02,,20
03,,18
04,,17
05,,14.3
06,,15.7
07,,14.7
08,,12.3
09,,10.7
10,,9.3
11,,11
12,,10.7
13,,10.3
14,,10.7
15,,11.3
16,,13.3
17,,13
18,,12.3
19,,9.7
20,,7.7
21,,7.3
22,,8.7
23,,7.3
24,,9
25,,8.7
26,,11.7
27,,10
28,,7.7
29,,5.3
30,,4.3
31,,6
32,,8.3
33,,7.3
34,,5.3
;
run;

proc sgplot data=original_data;
vbar Surveillance_Week / response=weekly_count_curryr
datalabel
barwidth=0.8
fillattrs=(color=green);
vline Surveillance_Week / response=rolling_avg_prevyr
lineattrs=(color=blue thickness=3);
xaxis label="Surveillance Week" type=discrete discreteorder=data; /* No grid option here removes vertical lines */
yaxis label="count" grid; /* Keeps horizontal grid lines */
keylegend / position=topright across=1;
run;

 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1726365265896.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100363iE62A6033ADD75043/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1726365265896.png" alt="Ksharp_0-1726365265896.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>Sun, 15 Sep 2024 01:54:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-control-label-for-the-x-axis/m-p/943961#M45232</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-09-15T01:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to control label for the x-axis</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-control-label-for-the-x-axis/m-p/943965#M45233</link>
      <description>Thank you  Ksharp. This exactly what I was looking for. Much appreciated.</description>
      <pubDate>Sun, 15 Sep 2024 02:26:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-control-label-for-the-x-axis/m-p/943965#M45233</guid>
      <dc:creator>bijayadhikar</dc:creator>
      <dc:date>2024-09-15T02:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to control label for the x-axis</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-control-label-for-the-x-axis/m-p/944091#M45235</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/346623"&gt;@bijayadhikar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to use &lt;CODE&gt;PROC SGPLOT&lt;/CODE&gt; with the following dataset. Currently with my script the x-axis goes from 1-52. I want the x-axis to start with week 35 and continue through week 52, then follow with weeks 1 to 34. Any assistance would be greatly appreciated.&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="bijayadhikar_0-1726320252779.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100361i77E3D060EB42AA06/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bijayadhikar_0-1726320252779.png" alt="bijayadhikar_0-1726320252779.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data original_data;&lt;BR /&gt;infile datalines dlm="," dsd;&lt;BR /&gt;input Surveillance_Week $ weekly_count_curryr rolling_avg_prevyr;&lt;BR /&gt;datalines;&lt;BR /&gt;35,15,7&lt;BR /&gt;36,11,5.7&lt;BR /&gt;37,,8.3&lt;BR /&gt;38,,9.7&lt;BR /&gt;39,,13.7&lt;BR /&gt;40,,15.3&lt;BR /&gt;41,,20&lt;BR /&gt;42,,24&lt;BR /&gt;43,,27&lt;BR /&gt;44,,27.7&lt;BR /&gt;45,,29.7&lt;BR /&gt;46,,32&lt;BR /&gt;47,,33&lt;BR /&gt;48,,30&lt;BR /&gt;49,,27.7&lt;BR /&gt;50,,24&lt;BR /&gt;51,,21&lt;BR /&gt;52,,15.3&lt;BR /&gt;53,,9.7&lt;BR /&gt;01,,13.7&lt;BR /&gt;02,,20&lt;BR /&gt;03,,18&lt;BR /&gt;04,,17&lt;BR /&gt;05,,14.3&lt;BR /&gt;06,,15.7&lt;BR /&gt;07,,14.7&lt;BR /&gt;08,,12.3&lt;BR /&gt;09,,10.7&lt;BR /&gt;10,,9.3&lt;BR /&gt;11,,11&lt;BR /&gt;12,,10.7&lt;BR /&gt;13,,10.3&lt;BR /&gt;14,,10.7&lt;BR /&gt;15,,11.3&lt;BR /&gt;16,,13.3&lt;BR /&gt;17,,13&lt;BR /&gt;18,,12.3&lt;BR /&gt;19,,9.7&lt;BR /&gt;20,,7.7&lt;BR /&gt;21,,7.3&lt;BR /&gt;22,,8.7&lt;BR /&gt;23,,7.3&lt;BR /&gt;24,,9&lt;BR /&gt;25,,8.7&lt;BR /&gt;26,,11.7&lt;BR /&gt;27,,10&lt;BR /&gt;28,,7.7&lt;BR /&gt;29,,5.3&lt;BR /&gt;30,,4.3&lt;BR /&gt;31,,6&lt;BR /&gt;32,,8.3&lt;BR /&gt;33,,7.3&lt;BR /&gt;34,,5.3&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc sgplot data=comb_adjusted;&lt;BR /&gt;where serial_num &amp;gt;= 3;&lt;BR /&gt;vbar adjusted_week / response=weekly_count_curryr &lt;BR /&gt;datalabel &lt;BR /&gt;barwidth=0.8 &lt;BR /&gt;fillattrs=(color=green);&lt;BR /&gt;vline adjusted_week / response=rolling_avg_prevyr &lt;BR /&gt;lineattrs=(color=blue thickness=3);&lt;BR /&gt;xaxis label="Surveillance Week"; /* No grid option here removes vertical lines */&lt;BR /&gt;yaxis label="count" grid; /* Keeps horizontal grid lines */&lt;BR /&gt;keylegend / position=topright across=1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Note that if you use a date value, such as the first day of the week, instead of an arbitrary number (1 - 52), that DATES will sort properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something along these lines:&lt;/P&gt;
&lt;PRE&gt;data original_data;
infile datalines dlm="," dsd;
input Surveillance_Week $ weekly_count_curryr rolling_avg_prevyr;
   if Surveillance_Week in (35:53) then weekdate = intnx('week','01JAN2022'd,Surveillance_Week-1);
   else weekdate =intnx('week','01JAN2023'd,Surveillance_Week-1);
   format weekdate date9.;
datalines;
35,15,7
36,11,5.7
37,,8.3
38,,9.7
39,,13.7
40,,15.3
41,,20
42,,24
43,,27
44,,27.7
45,,29.7
46,,32
47,,33
48,,30
49,,27.7
50,,24
51,,21
52,,15.3
53,,9.7
01,,13.7
02,,20
03,,18
04,,17
05,,14.3
06,,15.7
07,,14.7
08,,12.3
09,,10.7
10,,9.3
11,,11
12,,10.7
13,,10.3
14,,10.7
15,,11.3
16,,13.3
17,,13
18,,12.3
19,,9.7
20,,7.7
21,,7.3
22,,8.7
23,,7.3
24,,9
25,,8.7
26,,11.7
27,,10
28,,7.7
29,,5.3
30,,4.3
31,,6
32,,8.3
33,,7.3
34,,5.3
;
run;

proc sgplot data=original_data;
vbar weekdate / response=weekly_count_curryr
      datalabel
      barwidth=0.8
      fillattrs=(color=green)
;
vline weekdate / response=rolling_avg_prevyr
   lineattrs=(color=blue thickness=3);
   xaxis label="Surveillance Week" values= ('21AUG2022'd to '20AUG2023'd by week) 
               valuesrotate=vertical
   ;
   yaxis label="count" grid; /* Keeps horizontal grid lines */
   keylegend / position=topright across=1;
   format weekdate yyweeku3.;
run;&lt;/PRE&gt;
&lt;P&gt;Note that it is not helpful to show a data set that does not match that used by the procedure. Your Original_data does not have have half the variables used in the plot which is using COMB_ADJUSTED&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 14:58:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-control-label-for-the-x-axis/m-p/944091#M45235</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-09-16T14:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to control label for the x-axis</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-control-label-for-the-x-axis/m-p/944600#M45251</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp; thanks very much for providing some useful tips. Noted. Correct, I did not include all vars thinking may not be needed. All is good.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 14:10:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-control-label-for-the-x-axis/m-p/944600#M45251</guid>
      <dc:creator>bijayadhikar</dc:creator>
      <dc:date>2024-09-19T14:10:51Z</dc:date>
    </item>
  </channel>
</rss>

