get title of subplot back
조회 수: 4 (최근 30일)
이전 댓글 표시
hey Guys, I have 9subplots in 1 figure and I want to give the User of my program the possibility to click of one subplot and get the title back....
do u have any tips ?
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2014년 8월 8일
close
x=repmat((1:10)',1,9);
y=rand(10,9);
for k=1:9
subplot(3,3,k);
plot(x(:,k),y(:,k));
title(sprintf('title%d',k))
end
%------The code-----------------------
h=flipud(findobj(gcf,'type','axes'))
%-----get title N°5----------------
n=5
g=get(h(n),'title');
title_5=get(g,'string')
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Subplots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!