Clear Filters
Clear Filters

how to rotate X Tick Label ?

54 views (last 30 days)
Amr Hashem
Amr Hashem on 28 Jul 2015
Commented: Amr Hashem on 28 Jul 2015
I am using matlab R2009a and matlab R2012a
I want to rotate x tick label 45 degree, I use this code:
figure('color','w')
bar(cell2mat(a(:,2)));
set(gca,'XTick',1:size(a,1))
set(gca,'XTickLabel',a(:,1))
set(gca,'XTickLabelRotation',45)
set(gca,'YTick',0:max(cell2mat(a(:,2))))
axis tight
but it gives me an error
Error using ==> set
There is no 'XTickLabelRotation' property in the 'axes' class.
Error in ==> CountWordFreq02 at 51
set(gca,'XTickLabelRotation',45)
HOW I CAN SOLVE THIS ?
  1 Comment
Star Strider
Star Strider on 28 Jul 2015
The 'XTickLabelRotation' property was introduced in R2014b. You would have to use a text object in place of your x-tick labels. It allows text rotation.

Sign in to comment.

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 28 Jul 2015
Edited: Azzi Abdelmalek on 28 Jul 2015
The xticklabelrotation property is not supported by versions before Matlab R2014b. However you can find some application in File Exchange

More Answers (0)

Categories

Find more on Labels and Annotations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!