I cant seem to show the label name on the 2nd figure graph. is there any error with my script? Tried some editing on the command but cant seem to get it to work. And how do I add a title to both figures? Thanks!
if true
figure
plot(o_delta(90:840,485),'XData',[0:(D*1000)/750:(D*1000)]); %plot line y 485
xlabel('Distance(mm)');
ylabel('Delta(0kg)');
figure_FontSize=12;
set(get(gca,'XLabel'),'FontSize',figure_FontSize,'Vertical','top');
set(get(gca,'YLabel'),'FontSize',figure_FontSize,'Vertical','middle');
set(findobj('FontSize',10),'FontSize',figure_FontSize);
set(gca,'tickdir','in')
set(gca,'ticklength',[0.01 0.01]);
axis on
%%%%%%%%%%%%
figure
plot(delta_diff(90:840,485),'XData',[0:(D*1000)/750:(D*1000)]); %plot line y 485
xlabel('Distance(mm)');
ylabel('Delta(3kg)');
figure_FontSize=12;
set(get(gca,'XLabel'),'FontSize',figure_FontSize,'Vertical','top');
set(get(gca,'YLabel'),'FontSize',figure_FontSize,'Vertical','middle');
set(findobj('FontSize',10),'FontSize',figure_FontSize);
set(gca,'tickdir','in')
set(gca,'ticklength',[0.01 0.01]);
axis on
end

 채택된 답변

Mischa Kim
Mischa Kim 2014년 3월 7일
편집: Mischa Kim 2014년 3월 7일

0 개 추천

Just use the exact same code as for the first figure:
xlabel('Distance(mm)'); % remove xlabel1 =
ylabel('Delta(0kg)'); % remove ylabel1 =
figure_FontSize = 12;
set(get(gca,'XLabel'),'FontSize',figure_FontSize,'Vertical','top');
set(get(gca,'YLabel'),'FontSize',figure_FontSize,'Vertical','middle');

댓글 수: 7

Slarn
Slarn 2014년 3월 7일
편집: Slarn 2014년 3월 7일
i tried that, there is x-y label on the 1st figure but there is no x and y label on the 2nd figure
Mischa Kim
Mischa Kim 2014년 3월 7일
편집: Mischa Kim 2014년 3월 7일
What happens when you do a clear all and copy-paste-execute in the MATLAB command window of:
x = 0:0.1:10;
y = sin(x);
z = cos(x);
figure
plot(x,y)
xlabel('x')
ylabel('y')
figure_FontSize = 20;
set(get(gca,'XLabel'),'FontSize',figure_FontSize,'Vertical','top');
set(get(gca,'YLabel'),'FontSize',figure_FontSize,'Vertical','middle');
figure
plot(x,z)
xlabel('x')
ylabel('z')
figure_FontSize = 40;
set(get(gca,'XLabel'),'FontSize',figure_FontSize,'Vertical','top');
set(get(gca,'YLabel'),'FontSize',figure_FontSize,'Vertical','middle');
Slarn
Slarn 2014년 3월 7일
편집: Slarn 2014년 3월 7일
there is labelling on both figures but the method is not working on my current script. i uploaded my current script for your reference.
Mischa Kim
Mischa Kim 2014년 3월 7일
There is a figure command missing just before your last plot command. Add it and it should work.
Slarn
Slarn 2014년 3월 7일
i did check but there is figure before the plot command
Mischa Kim
Mischa Kim 2014년 3월 7일
I am talking about the plot command on line 103. Add a figure command right before and it should work.
Slarn
Slarn 2014년 3월 7일
편집: Slarn 2014년 3월 7일
thanks! I found the error, i deleted the plot command at line 104 and it works as i not going to plot that. finally all the labels show up! :D

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Labels and Annotations에 대해 자세히 알아보기

태그

질문:

2014년 3월 7일

편집:

2014년 3월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by