<?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: Only want the year to appear on my x-axis in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729684#M21240</link>
    <description>&lt;P&gt;Thank you so much! Your code works, I was only taught by my teachers the dollar sign is for "non-numerical" input so I didn't know this &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Mar 2021 02:35:32 GMT</pubDate>
    <dc:creator>thuphammm</dc:creator>
    <dc:date>2021-03-29T02:35:32Z</dc:date>
    <item>
      <title>Only want the year to appear on my x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729276#M21229</link>
      <description>&lt;P&gt;Hi everyone, first-time poster here!&lt;/P&gt;&lt;P&gt;So I have this data set:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="This is my data" style="width: 559px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56532i0D2D08AE54DEDA61/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-03-26 at 09.01.25.png" alt="This is my data" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;This is my data&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It produced a series plot like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="and this is the plot I got" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56531i8C5B515FB08BC5AA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-03-26 at 09.01.17.png" alt="and this is the plot I got" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;and this is the plot I got&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want my graph to look like this with the x-axis to consist only year, obviously i failed using the SAS code below because the x-axis looks right but there's no graph.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="I want the plot to have the x-axis like this (obviously I failed, the graph does not appear)" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56534i4AD069D2EB00478B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-03-26 at 09.00.39.png" alt="I want the plot to have the x-axis like this (obviously I failed, the graph does not appear)" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;I want the plot to have the x-axis like this (obviously I failed, the graph does not appear)&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="this is what I used" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56533iCCDCDE7F4A1CEBDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-03-26 at 09.00.23.png" alt="this is what I used" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;this is what I used&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please help &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 02:05:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729276#M21229</guid>
      <dc:creator>thuphammm</dc:creator>
      <dc:date>2021-03-26T02:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Only want the year to appear on my x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729278#M21230</link>
      <description>&lt;P&gt;I can't edit your code because you provided a picture.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this for your xaxis statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Xaxis values=('01Jan2010'd to '01Jan2020'd by year) valuesformat=year4.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ANY time you want to reference a specific value for a date value you must reference it as a quoted date9. or date7. value followed by d. The d tells SAS you want it treated as a date. The Date9 or Date7 because any other series of 6 or 8 digits might represent dates but only in a specific interpretation.&amp;nbsp; The VALUESFORMAT option allows you to override the default format for the values that appear for tick marks on an axis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the future please provide code or text from log entries by copying from the editor or log and pasting into a code box opened on the forum with the &amp;lt;/&amp;gt; icon. The message windows will reformat text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data is best provided as data step code. We cannot write code that will read a picture as data.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 03:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729278#M21230</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-26T03:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Only want the year to appear on my x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729290#M21231</link>
      <description>&lt;P&gt;Hi, thank you for your quick response, i've tried to put your SAS code in like below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html close;
ods html;

data tesla;
infile "/folders/myfolders/TSLA (2).csv" delimiter=',' firstobs=2;
input date $ open high low close adj_close vol;
format date MONYY7.;
informat date MONYY7.;
proc print data=tesla;

ods graphics on;
proc sgplot data=tesla;
series x=date y=open;
Xaxis values=('01Jan2010'd to '01Jan2020'd by year) valuesformat=year4.;
title 'TSLA Opening Price';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and it still doesn't work, this is the graph I got&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2021-03-26 at 13.27.37.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56536i744D47B304AA7145/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-03-26 at 13.27.37.png" alt="Screen Shot 2021-03-26 at 13.27.37.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any other suggestions? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 06:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729290#M21231</guid>
      <dc:creator>thuphammm</dc:creator>
      <dc:date>2021-03-26T06:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Only want the year to appear on my x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729346#M21232</link>
      <description>Try to change your format.&lt;BR /&gt;&lt;BR /&gt;input date $ open high low close adj_close vol;&lt;BR /&gt;format date MONYY7.;&lt;BR /&gt;&lt;BR /&gt;-----&amp;gt;&lt;BR /&gt;input date $ open high low close adj_close vol;&lt;BR /&gt;format date year4.;</description>
      <pubDate>Fri, 26 Mar 2021 11:08:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729346#M21232</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-03-26T11:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Only want the year to appear on my x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729490#M21234</link>
      <description>&lt;P&gt;If I submit this code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=SASHELP.STOCKS;
   where Stock="IBM";
   series x=date y=open;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I get results, along the lines of this:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;A class="" tabindex="0" href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=casecon&amp;amp;docsetTarget=casecon_hmm_examples01.htm&amp;amp;docsetVersion=8.2&amp;amp;locale=en#casecon.hmm.hmmex01oa" data-docset-id="casecon" data-docset-version="8.2" data-original-href="casecon_hmm_examples01.htm#casecon.hmm.hmmex01oa"&gt;Output 10.1.1&lt;/A&gt;&amp;nbsp;-&amp;nbsp;&lt;A style="font-family: inherit; background-color: #ffffff;" href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=casecon&amp;amp;docsetTarget=casecon_hmm_examples01.htm&amp;amp;locale=en#casecon.hmm.hmmex01oa"&gt;SAS Help Center: Example 10.1 Analysis of Stock Prices&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;What do you get?&amp;nbsp; Perhaps this will inform us somehow of what's going on.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 20:39:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729490#M21234</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-03-26T20:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Only want the year to appear on my x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729493#M21235</link>
      <description>&lt;P&gt;Why is there a "dollar sign" in you INPUT statement?&amp;nbsp; Is that it?&amp;nbsp; Is your date is a string?!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 20:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729493#M21235</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-03-26T20:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Only want the year to appear on my x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729510#M21236</link>
      <description>&lt;P&gt;Your INPUT statement seems wrong. You are defining DATE as character and then trying to attach numeric format and informat to it.&amp;nbsp; That will produce notes in the log.&lt;/P&gt;
&lt;PRE&gt;241   format date MONYY7.;
                  -------
                  484
242   informat date MONYY7.;
                    -------
                    485
NOTE 484-185: Format $MONYY was not found or could not be loaded.

NOTE 485-185: Informat $MONYY was not found or could not be loaded.

&lt;/PRE&gt;
&lt;P&gt;Try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input date :anydtdte. open high low close adj_close vol;
format date MONYY7.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 23:28:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729510#M21236</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-26T23:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Only want the year to appear on my x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729684#M21240</link>
      <description>&lt;P&gt;Thank you so much! Your code works, I was only taught by my teachers the dollar sign is for "non-numerical" input so I didn't know this &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 02:35:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Only-want-the-year-to-appear-on-my-x-axis/m-p/729684#M21240</guid>
      <dc:creator>thuphammm</dc:creator>
      <dc:date>2021-03-29T02:35:32Z</dc:date>
    </item>
  </channel>
</rss>

