<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254905</link>
    <title>MATLAB Central Newsreader - Axes ticks irregular spacing</title>
    <description>Feed for thread: Axes ticks irregular spacing</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>Mon, 29 Jun 2009 11:53:01 -0400</pubDate>
      <title>Axes ticks irregular spacing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254905#661194</link>
      <author>dage Tarari</author>
      <description>Hi all,&lt;br&gt;
&lt;br&gt;
I wonder if it is possible to create X axis ticks with non-monotonically increasing values. Example: if the x-axis represents time and we want to locate one tick for the first day of every month, the spacing will be 28 and 31 between 01 Feb, 01 Mar and 01 Apr, respectively.&lt;br&gt;
&lt;br&gt;
Thanks!!&lt;br&gt;
Belen</description>
    </item>
    <item>
      <pubDate>Mon, 29 Jun 2009 11:56:39 -0400</pubDate>
      <title>Re: Axes ticks irregular spacing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254905#661195</link>
      <author>Rune Allnor</author>
      <description>On 29 Jun, 13:53, &quot;dage Tarari&quot; &amp;lt;ahs...@hjg.es&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi all,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I wonder if it is possible to create X axis ticks with non-monotonically increasing values.&lt;br&gt;
&lt;br&gt;
Of course it is. Try:&lt;br&gt;
&lt;br&gt;
set(gca,'xtick',(0:0.2:1).^2)&lt;br&gt;
&lt;br&gt;
Rune</description>
    </item>
    <item>
      <pubDate>Mon, 29 Jun 2009 11:59:03 -0400</pubDate>
      <title>Re: Axes ticks irregular spacing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254905#661196</link>
      <author>us</author>
      <description>&quot;dage Tarari&quot; &amp;lt;ahsghd@hjg.es&amp;gt; wrote in message &amp;lt;h2a9ut$dmc$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi all,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I wonder if it is possible to create X axis ticks with non-monotonically increasing values. Example: if the x-axis represents time and we want to locate one tick for the first day of every month, the spacing will be 28 and 31 between 01 Feb, 01 Mar and 01 Apr, respectively.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks!!&lt;br&gt;
&amp;gt; Belen&lt;br&gt;
&lt;br&gt;
one of the solutions is outlined below&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;plot(1:10);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set(gca,...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'xtick',[1,2,pi,2*pi,9],...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'xticklabel',{'1','2','pi','2pi','9Hz'});&lt;br&gt;
&lt;br&gt;
us</description>
    </item>
    <item>
      <pubDate>Mon, 29 Jun 2009 12:02:01 -0400</pubDate>
      <title>Re: Axes ticks irregular spacing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254905#661199</link>
      <author>Belen </author>
      <description>Thank you so much Rune,&lt;br&gt;
Belen&lt;br&gt;
&lt;br&gt;
Rune Allnor &amp;lt;allnor@tele.ntnu.no&amp;gt; wrote in message &amp;lt;4c72e071-b1c2-49f6-8a7b-cea8dff43651@y7g2000yqa.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On 29 Jun, 13:53, &quot;dage Tarari&quot; &amp;lt;ahs...@hjg.es&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; Hi all,&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I wonder if it is possible to create X axis ticks with non-monotonically increasing values.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Of course it is. Try:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; set(gca,'xtick',(0:0.2:1).^2)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Rune</description>
    </item>
    <item>
      <pubDate>Mon, 29 Jun 2009 12:14:02 -0400</pubDate>
      <title>Re: Axes ticks irregular spacing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254905#661202</link>
      <author>Belen </author>
      <description>Excuse me Rune but I still haven't found the way to do the following:&lt;br&gt;
set(gca,'xtick',[0 31 59 90 120 151 181 212 243 273 304 334 365])&lt;br&gt;
0, 31, 28, etc. are julian days.&lt;br&gt;
I'll be very grateful for any advice,&lt;br&gt;
Belen&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Rune Allnor &amp;lt;allnor@tele.ntnu.no&amp;gt; wrote in message &amp;lt;4c72e071-b1c2-49f6-8a7b-cea8dff43651@y7g2000yqa.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On 29 Jun, 13:53, &quot;dage Tarari&quot; &amp;lt;ahs...@hjg.es&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; Hi all,&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I wonder if it is possible to create X axis ticks with non-monotonically increasing values.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Of course it is. Try:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; set(gca,'xtick',(0:0.2:1).^2)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Rune</description>
    </item>
    <item>
      <pubDate>Mon, 29 Jun 2009 12:25:03 -0400</pubDate>
      <title>Re: Axes ticks irregular spacing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254905#661204</link>
      <author>us</author>
      <description>&quot;Belen &quot; &amp;lt;ahsghd@hjg.es&amp;gt; wrote in message &amp;lt;h2ab6a$frb$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Excuse me Rune but I still haven't found the way to do the following:&lt;br&gt;
&amp;gt; set(gca,'xtick',[0 31 59 90 120 151 181 212 243 273 304 334 365])&lt;br&gt;
&amp;gt; 0, 31, 28, etc. are julian days.&lt;br&gt;
&amp;gt; I'll be very grateful for any advice,&lt;br&gt;
&amp;gt; Belen&lt;br&gt;
&lt;br&gt;
what's wrong with this perfect syntax?&lt;br&gt;
naturally, you have to PLOT/LINE/etc first - or - set the axis's xlim...&lt;br&gt;
otherwise, it does not show up...&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;plot(1:370);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set(gca,'xtick',[0 31 59 90 120 151 181 212 243 273 304 334 365]);&lt;br&gt;
&lt;br&gt;
us</description>
    </item>
    <item>
      <pubDate>Mon, 29 Jun 2009 13:13:46 -0400</pubDate>
      <title>Re: Axes ticks irregular spacing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254905#661222</link>
      <author>Steven Lord</author>
      <description>&lt;br&gt;
&quot;dage Tarari&quot; &amp;lt;ahsghd@hjg.es&amp;gt; wrote in message &lt;br&gt;
news:h2a9ut$dmc$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; Hi all,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I wonder if it is possible to create X axis ticks with non-monotonically &lt;br&gt;
&amp;gt; increasing values. Example: if the x-axis represents time and we want to &lt;br&gt;
&amp;gt; locate one tick for the first day of every month, the spacing will be 28 &lt;br&gt;
&amp;gt; and 31 between 01 Feb, 01 Mar and 01 Apr, respectively.&lt;br&gt;
&lt;br&gt;
Others have suggested setting the XTick and/or XTickLabel properties, but &lt;br&gt;
from your description I think you may prefer using the DATETICK function in &lt;br&gt;
addition.&lt;br&gt;
&lt;br&gt;
x = datenum(2009, 1:12, 1);&lt;br&gt;
y = (1:length(x)).^2;&lt;br&gt;
plot(x, y);&lt;br&gt;
set(gca, 'XTick', x)&lt;br&gt;
datetick('x', 6)&lt;br&gt;
&lt;br&gt;
% alternately, if you want all the first days labeled, replace the last line &lt;br&gt;
above with:&lt;br&gt;
datetick('x', 6, 'keepticks')&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Steve Lord&lt;br&gt;
slord@mathworks.com </description>
    </item>
    <item>
      <pubDate>Mon, 29 Jun 2009 13:19:01 -0400</pubDate>
      <title>Re: Axes ticks irregular spacing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254905#661226</link>
      <author>Belen </author>
      <description>Thank you very much US!! &lt;br&gt;
Belen&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;us &quot; &amp;lt;us@neurol.unizh.ch&amp;gt; wrote in message &amp;lt;h2abqv$9v$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Belen &quot; &amp;lt;ahsghd@hjg.es&amp;gt; wrote in message &amp;lt;h2ab6a$frb$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Excuse me Rune but I still haven't found the way to do the following:&lt;br&gt;
&amp;gt; &amp;gt; set(gca,'xtick',[0 31 59 90 120 151 181 212 243 273 304 334 365])&lt;br&gt;
&amp;gt; &amp;gt; 0, 31, 28, etc. are julian days.&lt;br&gt;
&amp;gt; &amp;gt; I'll be very grateful for any advice,&lt;br&gt;
&amp;gt; &amp;gt; Belen&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; what's wrong with this perfect syntax?&lt;br&gt;
&amp;gt; naturally, you have to PLOT/LINE/etc first - or - set the axis's xlim...&lt;br&gt;
&amp;gt; otherwise, it does not show up...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;      plot(1:370);&lt;br&gt;
&amp;gt;      set(gca,'xtick',[0 31 59 90 120 151 181 212 243 273 304 334 365]);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; us</description>
    </item>
    <item>
      <pubDate>Mon, 29 Jun 2009 13:23:01 -0400</pubDate>
      <title>Re: Axes ticks irregular spacing</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254905#661227</link>
      <author>Belen </author>
      <description>Thank you very much Steven. We are all used to program here in my office, but my  none of us knew how to do this simple irregular spacing. &lt;br&gt;
Best whishes,&lt;br&gt;
Belen&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;Steven Lord&quot; &amp;lt;slord@mathworks.com&amp;gt; wrote in message &amp;lt;h2aeku$pld$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;dage Tarari&quot; &amp;lt;ahsghd@hjg.es&amp;gt; wrote in message &lt;br&gt;
&amp;gt; news:h2a9ut$dmc$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; &amp;gt; Hi all,&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I wonder if it is possible to create X axis ticks with non-monotonically &lt;br&gt;
&amp;gt; &amp;gt; increasing values. Example: if the x-axis represents time and we want to &lt;br&gt;
&amp;gt; &amp;gt; locate one tick for the first day of every month, the spacing will be 28 &lt;br&gt;
&amp;gt; &amp;gt; and 31 between 01 Feb, 01 Mar and 01 Apr, respectively.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Others have suggested setting the XTick and/or XTickLabel properties, but &lt;br&gt;
&amp;gt; from your description I think you may prefer using the DATETICK function in &lt;br&gt;
&amp;gt; addition.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; x = datenum(2009, 1:12, 1);&lt;br&gt;
&amp;gt; y = (1:length(x)).^2;&lt;br&gt;
&amp;gt; plot(x, y);&lt;br&gt;
&amp;gt; set(gca, 'XTick', x)&lt;br&gt;
&amp;gt; datetick('x', 6)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; % alternately, if you want all the first days labeled, replace the last line &lt;br&gt;
&amp;gt; above with:&lt;br&gt;
&amp;gt; datetick('x', 6, 'keepticks')&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt; Steve Lord&lt;br&gt;
&amp;gt; slord@mathworks.com &lt;br&gt;
&amp;gt; </description>
    </item>
  </channel>
</rss>

