File Exchange

image thumbnail

Axisticks

version 1.1.0.0 (1.55 KB) by schwarzkater
This function is useful to make a dateaxis adjustable

0 Downloads

Updated 10 Feb 2014

View Version History

View License

To change the plot interval with date axis.
Inputs are time to begin and time to end with "datenum" format. Outputs are dateticks (format to make date ticks) and interval (interval to choose the width between ticks) example:

Ti=datenum(2013,10,30,0,0,0); % Date to begin 2013,oct,30,00:00:00
Tf=datenum(2013, 12, 30, 0,0, 0);

[tickformat,interval]=axisticks(Ti,Tf);

% And use this parameters on:
set(gca,'xtick',Ti:interval:Tf)
datetick('x',tickformat, 'keepticks', 'keeplimits')

Cite As

schwarzkater (2020). Axisticks (https://www.mathworks.com/matlabcentral/fileexchange/45409-axisticks), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

Ayal

Example bombs:

Error using datetick (line 155)
Unknown date format: DD-mmm HHh

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!