GUI plotting to axes once a seperate figure is opened

I have a gui that has a pushbutton and an axes. The push button runs a function (seperate m file) that creates a figure and some subplots. When I then try to do something on axes1 on the original GUI, its not plotting. Im guessing, it cant find the handle to the component as I also have a figure open.
im calling the axes1 component via: handles.axes1
It is the only component called axes1, so I cant understand why I can't plot to this once I have already plotted to a seperate figure?

1 件のコメント

Adam
Adam 2014 年 12 月 8 日
It would help if you post the actual plot instruction you are using for your axes1

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

回答 (2 件)

Robert Cumming
Robert Cumming 2014 年 12 月 8 日

0 投票

are you specifying the axes in the plot command? If not Matlab will plot in the current active axes (gca).
Its advisable to specify the axes to plot in:
plot ( axesHandle, X, Y, .... );
So in your case:
plot ( handles.axes1, X, Y, .... );
Jason
Jason 2014 年 12 月 8 日

0 投票

Hi, no I wasn't. I have just tried but still nothing.

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

タグ

質問済み:

2014 年 12 月 8 日

コメント済み:

2014 年 12 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by