フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Setting handle within multiple axes with GUIDE?

1 回表示 (過去 30 日間)
Brian
Brian 2014 年 7 月 18 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello, thanks for reading this,
I want to use multiple axes within a GUIDE gui I created, how can I handle the handle of multiple axes programmatically?
I've been given and experimented with this code:
h=figure
p1=subplot(2,1,1),plot(rand(10))
p2=subplot(2,1,2),plot(rand(4))
set(h,'windowscrollWheelFcn', 'plot(rand(10))');
set(h,'Windowbuttonupfcn', 'gca');
which sets the gca to a subplotted axes you click on, but that is a manual process. How can I set it without the need for the callback Windowbuttonupfcn?
Thanks!

回答 (1 件)

Supreeth Subbaraya
Supreeth Subbaraya 2014 年 8 月 4 日
The current axes handle (gca) is set to a axes of a subplot that is clicked on. So you do not need the “ Windowbuttonupfcn ” callback function. You can check this by commenting out the code on line number 5, and then click the subplots and see how the value of gca changes.
Also, if you want to set the existing axes “h” as the current axes, you can use the command “ axes(h)”. You can find the documentation for axes here

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by