GUI picture is already loaded in axes when GUI opens

I have a GUI that pulls images from a url then displays them in a figure with data plotted on top. The issue is, everytime I open the GUI, without interacting with any of the buttons, etc. there is already an image loaded in the axis fromm a previous time I used the program.
It doesn't update everytime I use the program, the image that preloads is one from a while ago and its always that image that loads. I though it midght have been a set handles error, but I don't see one.
I can add code if needed, but I wasn't sure if anyone else had already had this problem.
Thanks a bunch!

1 件のコメント

Sean de Wolski
Sean de Wolski 2011 年 6 月 24 日
Does it open with the image if you've close MATLAB between sessions?

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

 採用された回答

Matt Fig
Matt Fig 2011 年 6 月 24 日

1 投票

In the gui_OpeningFcn, put:
cla
reset(gca) % Should undo the zoom.

2 件のコメント

Matt Fig
Matt Fig 2011 年 6 月 24 日
Chris says,
Okay, that helped with the first issue. The reason that I was having difficulties was that the previous image that loaded was automatically zoomed in on the top left hand corner. When I loaded a new image, this image was also zoomed in on the top left corner automatically and not all of the image was put into the figure. However, when I create a new figure in the command prompt and run through all of the code again in the debugger everything works perfectly.
I hope that explanation makes sense.
Matt Fig
Matt Fig 2011 年 6 月 24 日
See the additional command in my suggestion.

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

その他の回答 (1 件)

Chris
Chris 2011 年 6 月 24 日

0 投票

The first one helped a lot. Thanks Matt. I figured out my second issue. I was calling the wrong figure handle when plotting the new figure. Thanks for your help though!

カテゴリ

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

製品

質問済み:

2011 年 6 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by