No BSD License  

Highlights from
Datetickzoom - automatically update dateticks

4.5

4.5 | 8 ratings Rate this file 43 Downloads (last 30 days) File Size: 2.48 KB File ID: #15029

Datetickzoom - automatically update dateticks

by

 

17 May 2007 (Updated )

Label axis with date ticks that automatically update when zooming or panning

| Watch this File

File Information
Description

DATETICKZOOM behaves completely identical to DATETICK, except that tick labels are automatically updated when zooming or panning.

Acknowledgements

This file inspired Datetick With Zooming Panning And Subplots and Tlabel.M V2.6.1 (Sep 2009).

MATLAB release MATLAB 7.3 (R2006b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (12)
14 Jun 2012 Fredrik

I agree on F Moisy comment from 2007. How do I use this witouth having to lose the date info when going down to hours and minutes?

07 Nov 2011 latheefth

Hi,

I need to zoom it to milli sec, but it happens only till second.
datetickzoom('x','HH:MM:SS.FFF');
Is there any way of doing it?

11 Jun 2011 Nicolas

hold arrowkey -> matlab crashes

21 Apr 2010 Karen  
13 Jan 2010 Marc Listmangof  
15 Dec 2009 adam  
09 Jun 2009 Florian

Hi Christophe,
I'm getting the error "One or more output arguments not assigned during call" in line 39 when using datetickzoom('x'). Any clue what I'm doing wrong?
Cheers

07 Mar 2008 Carlos Adrián Vargas Aguilera

Excellent job! Congratulations Christophe! I made a modification of your function and MATLAB's to put what is left by the ticks on the date-axis.

Rajesh: if time is in X-axis you can use
a = linkprop(h, {'XTick', 'XTickLabel', 'XLim', 'YLim'});
where h are your axes handles. And to link the label too:
b = linkprop(cell2mat(get(h,'XLabel')), 'String');

Cheers

07 Jan 2008 Rajesh Rajaram

It is a very nice option to add to matlab. It works great on a single plot.

However I am not sure how I could use it when I also need to use the linkaxes option to link multiple subplots.

24 May 2007 Dan Kominsky

Very nice. This has been an annoying aspect of MatLab for some time. Thank you.

18 May 2007 Christophe Lauwerys

Concerning your remark: the switching between different dateforms is desired behavior since, in my opinion, the resolution of the ticks should increase when zooming in.

18 May 2007 F Moisy

Very useful, thanks!

One remark: it seems that datetickzoom uses the input argument dateform=0 by default, even if a second input argument is given. For instance, datetickzoom('x',1) should display labels in the form 'dd-mmm-yyyy' whatever the zoom. Instead, it automatically switches between different dateforms when zooming.

Contact us