Code covered by the BSD License  

Highlights from
Zoom Adaptive Date Ticks

4.8

4.8 | 10 ratings Rate this file 19 Downloads (last 30 days) File Size: 1.6 KB File ID: #15342

Zoom Adaptive Date Ticks

by

 

18 Jun 2007 (Updated )

Make date ticks adapt to zooming

Editor's Notes:

This was a File Exchange Pick of the Week

| Watch this File

File Information
Description

% ZOOMADAPTIVEDATETICKS - Make date ticks adapt to zooming
%
% zoomAdaptiveDateTicks('on')
% Turns on the automatic adaptation of date ticks
% to user zooming for the current figure window
%
% zoomAdaptiveDateTicks('off')
% Turns off the automatic adaptation of date ticks
% to user zooming for the current figure window
%
% zoomAdaptiveDateTicks('demo')
% Opens a demo figure window to play with

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (10)
18 Aug 2014 Rafal Czarny  
06 Feb 2014 Diego  
27 Sep 2011 lflorhid

Very, very useful.. thank you very much

13 Jun 2011 Stijn de Waele

Useful script! For multiple axes with linked time axis, I have modified the code to:
function adaptiveDateTicks(figureHandle,eventObjectHandle)
% Resetting x axis to automatic tick mark generation
ax=findall(figureHandle,'type','axes');
arrayfun(@(x) set(x,'XTickMode','auto'),ax)
% using automaticallly generate date ticks
arrayfun(@(x) datetick(x,'x','keeplimits'),ax)

04 Apr 2011 Ryan Moffet  
26 Jul 2010 Hans Martin Aannestad

Thank you so much for this! I have struggled with 'manual mode' and updating date vectors for ages, this is such a simple and elegant solution.

02 Aug 2007 Richard Stephens

This is just what I've been looking for!
Thanks.

11 Jul 2007 Jeremy Almeter

This function is very useful. It is short, simple, and makes the graphs easier to read.

07 Jul 2007 Les Beckham

This is nice and should prove useful.

The 'demo' feature uses the 'today' function which, apparently, only ships with the Financial toolbox. If you replace the line
dates = today - linspace(1169,0,15000)';
with
dates = floor(now) - linspace(1169,0,15000)';

it will work without the 'today' function.

20 Jun 2007 Erik Stalberg

Thanks Andreas! This tool is very useful and the code is very well written.
Erik Stalberg

Contact us