<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/241477</link>
    <title>MATLAB Central Newsreader - plotting data and time</title>
    <description>Feed for thread: plotting data and time</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 23 Dec 2008 08:14:03 -0500</pubDate>
      <title>plotting data and time</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/241477#618512</link>
      <author>sujata </author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I have some data for which I need to plot the the date in format dd/mm/yyyy on the x-axis in a graph in a GUI. &lt;br&gt;
&lt;br&gt;
So far I did the following which kinda works:&lt;br&gt;
after I plotted the data I made a label vector:&lt;br&gt;
&lt;br&gt;
alldates =['30/09/2007' '31/10/2007'  etc until '31/11/2008' ] &lt;br&gt;
&lt;br&gt;
The all dates vector is quite long, it has a size of like 76 by 1. I do not need to plot all the 76 labels on the x-axis since it doesn't fit, so I made 7 equal spaces like the following.&lt;br&gt;
&lt;br&gt;
Spaces = floor(linspace(1,size(alldates,1),7));&lt;br&gt;
adjusted = alldates(Spaces,1) --&amp;gt; this selects the relevant dates for my axis&lt;br&gt;
set(axes_handles,'XTickLabel',adjusted);&lt;br&gt;
set(axes_handles,'XTick', Spaces);&lt;br&gt;
&lt;br&gt;
When I run the code, it works perfectly, except for one problem. When the data is plotted at the end of the graph there is a empty gap between the axis limits and the data. I used axis tight to set the axis limit to fit the range of the data but then my labels do not match the correct datapoints in the graph. &lt;br&gt;
&lt;br&gt;
I hope I described the problem as clearly as possible. Can someone help me how to match it nicely and correctly put my labels.&lt;br&gt;
&lt;br&gt;
Thanks in advance&lt;br&gt;
Sujata</description>
    </item>
  </channel>
</rss>

