<?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 Decrease amount of tick marks on x-axis using sgplot in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Decrease-amount-of-tick-marks-on-x-axis-using-sgplot/m-p/855255#M37685</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am outputting a graph for reporting and just recently changed the x-axis to a new variable. The issue I am running into is when the graph is generated, the x-axis looks very cluttered. How do I decrease tick marks without taking out the actual values?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code used to generate graph (Please note that x-axis is a character variable):&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;PROC SGPLOT DATA = freqweek&amp;amp;today. ;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;SERIES X = yr_week Y = PCT_COL;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;where def=1 &amp;amp; yr_week gt '2022wk01' &amp;amp; yr_week lt '2023wk02';&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;yaxis label='Placeholder' values=(0.0 to 100.0 by 10);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;xaxis label='Placeholder';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;TITLE 'Placeholder';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;RUN;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;What is being outputted:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="scolitti1_0-1674512698377.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79672i087606FCB9CF1A90/image-size/medium?v=v2&amp;amp;px=400" role="button" title="scolitti1_0-1674512698377.png" alt="scolitti1_0-1674512698377.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jan 2023 22:25:53 GMT</pubDate>
    <dc:creator>scolitti1</dc:creator>
    <dc:date>2023-01-23T22:25:53Z</dc:date>
    <item>
      <title>Decrease amount of tick marks on x-axis using sgplot</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Decrease-amount-of-tick-marks-on-x-axis-using-sgplot/m-p/855255#M37685</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am outputting a graph for reporting and just recently changed the x-axis to a new variable. The issue I am running into is when the graph is generated, the x-axis looks very cluttered. How do I decrease tick marks without taking out the actual values?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code used to generate graph (Please note that x-axis is a character variable):&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;PROC SGPLOT DATA = freqweek&amp;amp;today. ;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;SERIES X = yr_week Y = PCT_COL;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;where def=1 &amp;amp; yr_week gt '2022wk01' &amp;amp; yr_week lt '2023wk02';&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;yaxis label='Placeholder' values=(0.0 to 100.0 by 10);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;xaxis label='Placeholder';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;TITLE 'Placeholder';&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;RUN;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;What is being outputted:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="scolitti1_0-1674512698377.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79672i087606FCB9CF1A90/image-size/medium?v=v2&amp;amp;px=400" role="button" title="scolitti1_0-1674512698377.png" alt="scolitti1_0-1674512698377.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 22:25:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Decrease-amount-of-tick-marks-on-x-axis-using-sgplot/m-p/855255#M37685</guid>
      <dc:creator>scolitti1</dc:creator>
      <dc:date>2023-01-23T22:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Decrease amount of tick marks on x-axis using sgplot</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Decrease-amount-of-tick-marks-on-x-axis-using-sgplot/m-p/855256#M37686</link>
      <description>&lt;P&gt;Your variable named YR_WEEK is obviously a character variable, and it has lots of values, and so each one is plotted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you really want is a variable that is numeric — all dates in SAS should be (I would say MUST be) numeric, and dates in SAS are the number of days since 01JAN1960, formatted to be readable. So convert your dates to a SAS numeric variable, format it any way you want, and then the numeric variable ought to plot in a more reasonable way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How did you create these text strings for YEAR_WK? If we knew that, we could provide code to create a numeric date value in a new variable that will plot properly.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 22:29:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Decrease-amount-of-tick-marks-on-x-axis-using-sgplot/m-p/855256#M37686</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-01-23T22:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Decrease amount of tick marks on x-axis using sgplot</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Decrease-amount-of-tick-marks-on-x-axis-using-sgplot/m-p/855259#M37687</link>
      <description>&lt;P&gt;The issue is that I have been asked to report by week, and I was using the weekw5. format, but after the new year, it was not capturing the full week due to the year change. The yr_week variable captures the week starting on Sunday through the following Saturday.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yr_week was created using this code:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;yr_week=cats(year(admitdate), "wk", put(week(admitdate),z2.));&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 22:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Decrease-amount-of-tick-marks-on-x-axis-using-sgplot/m-p/855259#M37687</guid>
      <dc:creator>scolitti1</dc:creator>
      <dc:date>2023-01-23T22:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Decrease amount of tick marks on x-axis using sgplot</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Decrease-amount-of-tick-marks-on-x-axis-using-sgplot/m-p/855261#M37688</link>
      <description>&lt;P&gt;Assign format &lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/nlsref/n1xryy2xjp1t27n1iz0g30udn3kp.htm" target="_self"&gt;YYWEEKW7.&lt;/A&gt; (or whatever number you want) to variable ADMITDATE, and then plot ADMITDATE&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 22:43:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Decrease-amount-of-tick-marks-on-x-axis-using-sgplot/m-p/855261#M37688</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-01-23T22:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Decrease amount of tick marks on x-axis using sgplot</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Decrease-amount-of-tick-marks-on-x-axis-using-sgplot/m-p/855266#M37689</link>
      <description>&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;PRE&gt;PROC SGPLOT DATA = freqweek&amp;amp;today. ;
SERIES X = &lt;FONT size="4" color="#FF0000"&gt;&lt;STRONG&gt;admit_date&lt;/STRONG&gt; &lt;/FONT&gt;Y = PCT_COL;
where def=1 &amp;amp; &lt;FONT size="4" color="#FF0000"&gt;&lt;STRONG&gt;admit_date gt '01Jan2022'd &amp;amp; admit_date  lt '14Jan2023'd;&lt;/STRONG&gt; &lt;/FONT&gt;
yaxis label='Placeholder' values=(0.0 to 100.0 by 10);
xaxis label='Placeholder' &lt;FONT size="4" color="#FF0000"&gt;&lt;STRONG&gt;values = ('01Jan2022'd to '14Jan2023'd by 14) valuesformat= yyweekw7.&lt;/STRONG&gt;&lt;/FONT&gt;;
TITLE 'Placeholder';
RUN;&lt;/PRE&gt;
&lt;P&gt;Something like above. You may need to adjust your dates to get it exactly as desired.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/386127"&gt;@scolitti1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The issue is that I have been asked to report by week, and I was using the weekw5. format, but after the new year, it was not capturing the full week due to the year change. The yr_week variable captures the week starting on Sunday through the following Saturday.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yr_week was created using this code:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#3366FF"&gt;yr_week=cats(year(admitdate), "wk", put(week(admitdate),z2.));&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 23:15:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Decrease-amount-of-tick-marks-on-x-axis-using-sgplot/m-p/855266#M37689</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-01-23T23:15:35Z</dc:date>
    </item>
  </channel>
</rss>

