Info

This question is closed. Reopen it to edit or answer.

axes position differs between two consecutive GUI executions

1 view (last 30 days)
Hey,
An axes in my GUI is behaving differently between two consecutive executions of my GUI.
When I start Matlab and then run my GUI, the mentioned axes' position is not where it is supposed to be. When I close the GUI and immediately afterwards restart the GUI the said axes is in its supposed to be position. I can then restart the GUI as often as I want and the axes behaves as expected and is in its right position. It is only when I freshly start Matlab, and right after that the GUI, that it behaves as described above.
I desinged the GUI using GUIDE and I do some GUI initilizations in the OpeningFcn. However, as far as I know I nowhere modify the position of the mentioned axes. GUIDE is the only way I modified the axes position.
I have no idea how to provide a minimal working example to show what I mean. Hence, see the picture below that shows a "Wrong-Right"-screenshot of the GUI to get an impression.
Any idea what the problem might be and how to solve it?
Thank you alot in advance!
Best regards
Hannes
  6 Comments
Adam
Adam on 27 Sep 2014
Edited: Adam on 27 Sep 2014
Have you tried programatically setting it's position in the Opening Fcn to what it is supposed to be? Obviously logically that is a silly thing to do since GUIDE already has the correct position, but you never know, it may work.
I have had some issues, not quite like that, but similar with my GUIs where I plot an image and my axes move slightly when the image is plotted. I never looked into why as it seemed to difficult too pin down, but I also hadn't given any position instructions other than those in GUIDE.
(Now that it is morning I can easily see the difference now!!)
Hannes
Hannes on 27 Sep 2014
I did try to change it by setting the position programmatically in my OpeningFcn - didn't change anything.
I now replaced the axes with a pushbutton. That simplyfied my code and the pushbutton stays where its supposed to be :). I know, that doesn't solve the initial problem of why the axes behaves this weird, its just a workaround. I'm still interested in why the axes is behaving like it does. So if anyone has any thoughts about that I am glad to here them!
Thank you all for your help! :)

Answers (0)

Community Treasure Hunt

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

Start Hunting!