Title disappears sometimes somtimes not

조회 수: 8 (최근 30일)
Jürgen
Jürgen 2013년 1월 7일
Hi, I generate a subplot with the code below. Normally that gives me 8 subplots with a title but for some subplots the title disappears, and when I run the code again, or when I restart matlab, it is solved or other title disappear? Strange, can I solve this? thanks for any help, regardsJ
FigH=figure('name', 'LMS errorbars Campos*Sch');
Campos=[100:10:170];
for Counter= 1:8
subplot(4,2,Counter);
title(int2str(Campos(Counter)));
hold on;
StartLijn=3+4* Counter;
EindLijn= StartLijn+3;
Y=LMS(StartLijn:EindLijn,4);
E=LMS(StartLijn:EindLijn,5);
errorbar(1,Y(1),E(1),'r*')
errorbar(2,Y(2),E(2),'b^')
errorbar(3,Y(3),E(3),'m*')
errorbar(4,Y(4),E(4),'k^')
set(gca,'XTick',[1:1:4], 'XTickLabel',{'short PC' ,'short HS' ,'long PC' ,'long HS'})
end

채택된 답변

Anthony Poulin
Anthony Poulin 2013년 1월 7일
Hy, I have not the problem when I run your code. I think it can be cause by a script execution...
Have you test to use the 'drawnow' function which force tu update the figure before execute the next line in your script. I think, it could works every time if you put this command between this lines, like this:
title(int2str(Campos(Counter)));
drawnow;
hold on;

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by