フィルターのクリア

get title of subplot back

4 ビュー (過去 30 日間)
Max Müller
Max Müller 2014 年 8 月 8 日
コメント済み: Max Müller 2014 年 8 月 8 日
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 ?

採用された回答

Azzi Abdelmalek
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')
  2 件のコメント
Max Müller
Max Müller 2014 年 8 月 8 日
Thanks....but ur "n" isnt a variable, which gets its value by clicking on the plot....its a variable the user needs to type in manuel.
Max Müller
Max Müller 2014 年 8 月 8 日
Thanks

サインインしてコメントする。

その他の回答 (1 件)

Max Müller
Max Müller 2014 年 8 月 8 日
編集済み: Max Müller 2014 年 8 月 8 日
function main
Plot = figure set(Plot,'name','Plot','Tag','Plot','numbertitle','off');
for i = 1:9
a = rand(1,1) * 100
b = rand(1,1) * 3
x = 1:100
y = x.^b +a
subplot(5,2,i)
plot(x,y)
title([num2str(i)])
end
Data = findobj('type','axes');
disp('ok1')
disp(Data)
set(Data,'buttondownfcn',@click)
disp('ok2')
function click (gcbo,evendata,handles)
disp(gca)

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by