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



Personal Profile:


Watch this Author's files


Comments and Ratings by Patrick
Updated File Comments Rating
03 Jun 2009 Rotate Tick Label ROTATETICKLABEL rotates tick labels. Author: Andrew Bliss

If the y axis is log scale this code will put the new x tickmarks in thw wrong place. Replace "c(1)-.1*(c(2)-c(1))" with the variable "yoffset" and add the following before the text commands to fix the problem:

%get the y axis scale type
yst = get(h,'YScale');
%set up new y location based on scale type of y axis
if strcmp(yst,'log')
c = log10(c)/10;
yoffset = 10^(c(1)-.1*(c(2)-c(1)));
yoffset = c(1)-.1*(c(2)-c(1));

If your x ticks are 10^something, you can put those back by adding this before the text commands:

%fix for tick lables with exponents
xst = get(h,'XScale');
if strcmp(xst,'log')
a = [repmat('10^{',length(a),1) a repmat('}',length(a),1)];

Contact us