Rank: 243685 based on 0 downloads (last 30 days) and 0 file submitted
photo

Vaibhav Jain

E-mail
Company/University
Vienna University of Technology

Personal Profile:

www.vaibhavjain.co

Professional Interests:
Research

 

Watch this Author's files

 

Comments and Ratings by Vaibhav View all
Updated File Comments Rating
10 Jun 2012 rotateXLabels( ax, angle, varargin ) Rotate x-tick labels to any angle, preserving font settings and coping with resize, zoom, pan etc Author: Ben Tordoff

Hi Ben,

Thank you for your function. It works absolutely perfect but I am facing a problem when converting the x ticks to mm/dd hh:mm format using datetick command. The eroor message arises specifically when I increase the number of x ticks beyond a certain limit (more than 8 in this case) using linspace command.

Please look at the following code. I have tried to explain its steps in the commented lines. In the end I am pasting the error message I get on running. I would like to know your views on it. Thanks again!

file=importdata('HourlyTemperature.csv');
DateTime=file.textdata(2:end,1);
% textdata is a <168x1 double> array with values in 'dd/mm hh:mm:ss' format

DateTime=datenum(DateTime);
% Converts mm/dd hh:mm to numeric values

Temperature=file.data(:,1);
% data is a <168x1 double> array with numeric format

plot(DateTime,Temperature);
datetick('x','dd/mm HH:MM:SS','keepticks');
xData=linspace(735105.0416666666,735112,8);
% linspace('first value of DateTime array', 'last value of DateTime array',
% 'number of XTicks in between')

set(gca,'XTick',xData)

rotateXLabels(gca, 90)

Error message:
??? Index exceeds matrix dimensions.

Error in ==> rotateXLabels>createNewLabels at 132
textLabels(ll) = text( ...

Error in ==> rotateXLabels at 35
h = createNewLabels( ax, vals, labels, angle );

Error in ==> HourlyTempPlot at 29
rotateXLabels(gca, 90)

- Vaibhav Jain

10 Jun 2012 rotateXLabels( ax, angle, varargin ) Rotate x-tick labels to any angle, preserving font settings and coping with resize, zoom, pan etc Author: Ben Tordoff

Contact us