필터 지우기
필터 지우기

how to rotate x-ticklabel for date?

조회 수: 4 (최근 30일)
Md. Moklesur Rahman
Md. Moklesur Rahman 2012년 9월 27일
Hello everyone,
In fact, I plotted my data against date using the following code but my x-axis ticklabel are overlaped. So, I am trying to rotate my x-axis ticklabel which is giving an error.
clear all; clc;
fid=fopen('GEM.dat');
data_f1=textscan(fid,'%f %f %f %f %f %f %f %f %f %f %f %f', 'delimiter',':/','collectoutput',1,'headerlines',1);
N = size(data_f1{1},1); % number of rows
t = datenum([data_f1{1}(:,[3 1 2 4 5]) zeros(N,1)]);
A = datestr(t, 'yyyy-mm-dd HH:MM:SS');
C = (data_f1{1}(:,6:11));
plot(t,C(:,1));
xpts = min(t):max(t);
set(gca,'XTick',xpts,'XTickLabel',datestr(xpts));
th=rotateticklabel(gca,45);
% rotateXTickLabel(gca, 45)
close all;
the error is ??? Undefined function or method 'rotateticklabel' for input arguments of type 'double'.
Does any of my friends have any idea how can I get rid of this problem? Thank you very much in advance for helping me.

채택된 답변

Matt Fig
Matt Fig 2012년 9월 27일
편집: Matt Fig 2012년 9월 27일
Did you forget to download the function and put it in a folder that is on your path?
  댓글 수: 4
Md. Moklesur Rahman
Md. Moklesur Rahman 2012년 9월 27일
Thanks a lot Matt. It did serve the purpose of rotating the x-axis label. But still I have some problem and that is my x-axis label is above the axis that I want below the axis. And the date interval is by one day that I want by fifteen days for a clear view. Any suggestions please? Thanks again
Carlos Monrabal
Carlos Monrabal 2013년 3월 27일
HI¡
Firstly, thanks for the programme. But how could I change the fontsize of the x-axis label? because once I run rotateticklabel.m I can only modify the size by clicking manually in each label.
I hope you can sort this out¡
thanks again

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by