datetick()
datetick(tickaxis)
datetick(tickaxis, dateFormat)
datetick(..., 'keeplimits')
datetick(..., 'keepticks')
datetick(ax, ...)
| Parameter | Description |
|---|---|
| tickaxis | Axis to label: 'x' (default), 'y' or 'z'. |
| dateFormat | Date format, given as a datestr format string (for example 'yyyy') or format number. |
| 'keeplimits' | Keep the current axis limits. |
| 'keepticks' | Keep the current tick locations. |
| ax | Target axes. Default is the current axes. |
datetick labels the ticks of an axis using dates, treating the tick values as serial date numbers (see datenum).
When no format is given, a format is chosen from the range spanned by the ticks. Use keepticks to preserve the current tick locations and keeplimits to preserve the current limits.
t = datenum(2000, 1, 1):365:datenum(2010, 1, 1);
plot(t, rand(1, numel(t)));
datetick('x', 'yyyy');
| Version | Description |
|---|---|
| 2.0.0 | initial version |