필터 지우기
필터 지우기

datetick : how to handle x Axis ?

조회 수: 1 (최근 30일)
Louis Deslée
Louis Deslée 2015년 4월 6일
댓글: Louis Deslée 2015년 4월 8일
Hi guys,
I have a little problem with datetick. I want to plot something like Flux=fct(time). I want to display on the X axis each month in the interval of time (from May 1st to the end of Novembre) but instead datetick display only Jully and October on the axis... I tried to use 'keeplimits' and 'keepticks' but nothing changed. Can you help me ?
here is my code
%%simples dynamiques temporelles des flux de voc
d=d+1;
figure(d);
fig=0;
for i = 1:length(Idxflux);
fig=fig+1;
subplot(3,2,fig);
hold on;
plot(output_2014.data(:,Idxdate_output_2014),output_2014.data(:,Idxflux(i)),'color',[0.5 0.5 0.5]);
%plot(output_2014.data(:,Idxdate_output_2014),output_2014.data(:,IdxDL(i)),'b');
datetick('x','mmm','keepticks');
xlim([datenum(2014,5,1,0,0,0) datenum(2014,12,1,0,0,0)]);
ylabel(output_2014.colheaders(Idxflux(i)),'FontSize',14);
if i <= length(Idxflux)-2;
set(gca, 'XTickLabel', []);
end
set(gca,'FontSize',14);
grid on;
hold off;
end
And here is what I get
  댓글 수: 1
Louis Deslée
Louis Deslée 2015년 4월 8일
Is there anybody to help me ?

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

답변 (1개)

Stalin Samuel
Stalin Samuel 2015년 4월 6일
set(gca,'xticklabel',{'May' ,'June' ,'July','August ','September ','October ','November'})
  댓글 수: 1
Louis Deslée
Louis Deslée 2015년 4월 6일
편집: Louis Deslée 2015년 4월 6일
First thank you for taking the time to reply. But I'm afraid your solution didn't worked. Again, only two months are displayed (june and july) but at the exact place of july and octobre, so the aren't a the right place on the axis. It's worse than before...

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by