How to add figure title and axes labels for multiple plots?

조회 수: 24 (최근 30일)
mmenvo
mmenvo 2013년 6월 5일
I have plotted multiple plots in a single figure in matlab. Now i want to add figure title and axes (X, Y) labels. How can i do that.
I have tried with the following codes, however the problem is that they (tile and labels) only appears at the last plot instead of showing for the whole figure. Any idea or codes please!
if true
Input = xlsread('Data.xlsx');
for ii = 1:29
subplot(6,5,ii)
scatter(Input(:,1),Input(:,ii+1));
hold on
end
title('Multiple scatter plot of all simulated reff values from various input combinations');
xlabel('association');
ylabel('Effective radius in micrometer');
end

채택된 답변

Jonathan Epperl
Jonathan Epperl 2013년 6월 5일
Whatever you want to have on every axis, just move it inside the for loop, like so
% if true % what is the point of this?
Input = xlsread('Data.xlsx');
for ii = 1:29
subplot(6,5,ii)
scatter(Input(:,1),Input(:,ii+1));
% hold on % you don't need to hold on
title('Multiple scatter plot of all simulated reff values from various input combinations');
xlabel('association');
ylabel('Effective radius in micrometer');
end
% end
  댓글 수: 4
mmenvo
mmenvo 2013년 6월 7일
Many thanks for your codes and concept.
When i run above code (which you provide) i get following error message from matlab:
??? Error using ==> set
Ambiguous property found.
Object Name : axes
And most importantly, nothing can be seen in the output figure.
Jonathan Epperl
Jonathan Epperl 2013년 6월 7일
Is there maybe a variable named axes in your workspace? I am not getting any errors when I run the above. Run
whos axes
does that display anything?

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

추가 답변 (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