how to put function's out put plot in Guide axes

3 ビュー (過去 30 日間)
alireza kooshafar
alireza kooshafar 2018 年 11 月 16 日
コメント済み: Adam Danz 2018 年 11 月 16 日
Hi all
I have a function which has a figure as output . now I'm trying to use this function as part of my GUI and i want to put this figure in axes of my GUI.thanks for any solotion.

採用された回答

Adam Danz
Adam Danz 2018 年 11 月 16 日
Suppose your function produces the following figure
figure;
axHand = axes;
hold(axHand, 'on')
plot(rand(10));
plot(rand(10), 'o')
and your GUI figure axis is named 'guiAxisHandle'. To copy everything in 'axHand' to 'guiAxisHandle',
copyobj(axHand.Children, guiAxisHandle)
Now you can delete the orginal figure.
delete(axHand.Parent)
  4 件のコメント
alireza kooshafar
alireza kooshafar 2018 年 11 月 16 日
thanks again dear adam
I dont know why but the result in axis is just the second plot and nothing plotted for the first plot(which is in the loop)
Adam Danz
Adam Danz 2018 年 11 月 16 日
I don't know what axis you're referring to and I don't know what the first and second plot are nor do I know what loop your're talking about. I assume you made some changes to your code so 1) could you share the updated code and 2) try to explain what you'd like it to do and 3) what's wrong with it?

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by