<?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 time x-axis not evenly spaced with major tick marks every 10 years in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/time-x-axis-not-evenly-spaced-with-major-tick-marks-every-10/m-p/340472#M11824</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to plot monthly market data over 100 years, with a major tick every 10 years, and no minor tick. I started with this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	axis1 order=('30Jun1930'd to '30Jun2020'd by 3640) label=(h=1.5 color=black 'Time') minor=none;
	axis2 order=(-3 to 18 by 1) label=(angle=90 h=1.5 color=black 'Cumulative wealth (log)') minor=none;
&lt;BR /&gt;proc gplot data = Sample;
	plot (ln_Wealth_Portfolio ln_Wealth_Index) * Date / haxis=axis1 vaxis=axis2 legend overlay ;
	format Date YEAR4.;
	run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote "by 3640", i.e. roughly 364*10, because I noticed that it counts in days but it is rather approximate. Would it be possible to count in years? I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;('30Jun1930'd to '30Jun2020'd by year)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;with the intention to add a 10 somewhere, but it leads to the following error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WARNING: The intervals on the axis labeled "Calendar Date" are not evenly spaced.
WARNING: No minor tick marks will be drawn because major tick increments have been specified in uneven or unordered intervals.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;because my dates are actually the last trading day for each month, which is not necessarily the last calendar day of the month.&lt;/P&gt;&lt;P&gt;Ex: 10/31/1933, 11/29/1933, 12/30/1933&lt;/P&gt;&lt;P&gt;with an "YYMMDD8." informat.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your suggestions,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2017 16:23:30 GMT</pubDate>
    <dc:creator>Alain38</dc:creator>
    <dc:date>2017-03-13T16:23:30Z</dc:date>
    <item>
      <title>time x-axis not evenly spaced with major tick marks every 10 years</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/time-x-axis-not-evenly-spaced-with-major-tick-marks-every-10/m-p/340472#M11824</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to plot monthly market data over 100 years, with a major tick every 10 years, and no minor tick. I started with this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	axis1 order=('30Jun1930'd to '30Jun2020'd by 3640) label=(h=1.5 color=black 'Time') minor=none;
	axis2 order=(-3 to 18 by 1) label=(angle=90 h=1.5 color=black 'Cumulative wealth (log)') minor=none;
&lt;BR /&gt;proc gplot data = Sample;
	plot (ln_Wealth_Portfolio ln_Wealth_Index) * Date / haxis=axis1 vaxis=axis2 legend overlay ;
	format Date YEAR4.;
	run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote "by 3640", i.e. roughly 364*10, because I noticed that it counts in days but it is rather approximate. Would it be possible to count in years? I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;('30Jun1930'd to '30Jun2020'd by year)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;with the intention to add a 10 somewhere, but it leads to the following error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WARNING: The intervals on the axis labeled "Calendar Date" are not evenly spaced.
WARNING: No minor tick marks will be drawn because major tick increments have been specified in uneven or unordered intervals.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;because my dates are actually the last trading day for each month, which is not necessarily the last calendar day of the month.&lt;/P&gt;&lt;P&gt;Ex: 10/31/1933, 11/29/1933, 12/30/1933&lt;/P&gt;&lt;P&gt;with an "YYMMDD8." informat.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your suggestions,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 16:23:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/time-x-axis-not-evenly-spaced-with-major-tick-marks-every-10/m-p/340472#M11824</guid>
      <dc:creator>Alain38</dc:creator>
      <dc:date>2017-03-13T16:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: time x-axis not evenly spaced with major tick marks every 10 years</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/time-x-axis-not-evenly-spaced-with-major-tick-marks-every-10/m-p/340506#M11825</link>
      <description>&lt;P&gt;Try using PROC SGPLOT and see if you get a better-looking time axis:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sgplot data = Sample;
        xaxis values=('30Jun1930'd to '30Jun2020'd) label='Time';	
	yaxis values=(-3 to 18 by 1) label='Cumulative wealth (log)';
        scatter y=ln_Wealth_Portfolio x=Date;	
        scatter y=ln_Wealth_Index x=Date;
	format Date YEAR4.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can also use the INTERVAL option on the XAXIS statement to control the time interval used onthe axis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 17:26:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/time-x-axis-not-evenly-spaced-with-major-tick-marks-every-10/m-p/340506#M11825</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2017-03-13T17:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: time x-axis not evenly spaced with major tick marks every 10 years</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/time-x-axis-not-evenly-spaced-with-major-tick-marks-every-10/m-p/340507#M11826</link>
      <description>&lt;P&gt;You should try using SGPLOT instead. It handles time axes much better. You can specify&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;xaxis type=time interval=year;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 17:29:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/time-x-axis-not-evenly-spaced-with-major-tick-marks-every-10/m-p/340507#M11826</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-03-13T17:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: time x-axis not evenly spaced with major tick marks every 10 years</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/time-x-axis-not-evenly-spaced-with-major-tick-marks-every-10/m-p/340530#M11831</link>
      <description>&lt;P&gt;When you use date values in an axis&amp;nbsp;you will often get this message:&lt;/P&gt;
&lt;P&gt;WARNING: The intervals on the &lt;SPAN class="token statement"&gt;axis&lt;/SPAN&gt; labeled &lt;SPAN class="token string"&gt;"Calendar Date"&lt;/SPAN&gt; are &lt;SPAN class="token operator"&gt;not&lt;/SPAN&gt; evenly spaced&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;The number of days in months are not the same and neither are the numbers of days in a year. So the tick marks are drawn evenly spaced but the VALUES represented by the tickmarks are not. It is not an error so if the graph looks as needed then ignore it.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 18:11:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/time-x-axis-not-evenly-spaced-with-major-tick-marks-every-10/m-p/340530#M11831</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-13T18:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: time x-axis not evenly spaced with major tick marks every 10 years</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/time-x-axis-not-evenly-spaced-with-major-tick-marks-every-10/m-p/340552#M11833</link>
      <description>&lt;DIV class="lia-message-body lia-component-body"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;@ DanH_sas Your code with sgplot looks nice, I will look deeper into it to customize it more. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@ ballardw That's good to know, thank you for the explanation!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 13 Mar 2017 18:56:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/time-x-axis-not-evenly-spaced-with-major-tick-marks-every-10/m-p/340552#M11833</guid>
      <dc:creator>Alain38</dc:creator>
      <dc:date>2017-03-13T18:56:11Z</dc:date>
    </item>
  </channel>
</rss>

