MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by Slobodan Djordjevi?
on 21 Dec 2011

Hello!

Quick question!

If I maximize my GUI, it maximizes. But when I click on a PushButton to refresh graph(new data) it throws me out. It still has the exact size, it just shifts a centimeter in diagonal direction.

Any idea why this is happening?

*No products are associated with this question.*

Answer by Aldin
on 21 Dec 2011

Zdravo

Imaš odmah na početku kada ulaziš u GUI (guide) opciju - GUI with Axes and Menus. Mislim da je to rješenje tvog problema.

Slobodan Djordjevi?
on 21 Dec 2011

Pa da, znam. I to sam odabrao na početku. Odabrao sam i "proportional resizing" u onom "GUI options". Ja mislim da je treba učiniti nešto u vezi sa ResizeFcn.

## 6 Comments

## Sean de Wolski

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/24499#comment_53937

Do you have a resizefcn defined? Is this gui in GUIDE?

## Eric Keller

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/24499#comment_54009

what does, "it throws me out" mean?

## Jan Simon

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/24499#comment_54037

How do you maximize the figure? Do you set the position manually to the screen coordinates? What does the function to refresh the graph do exactly? Which operating system and Matlab version are you using?

## Slobodan Djordjevi?

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/24499#comment_54068

I'm sorry for a late response, didn't know comments go through with no email notifications.

I have my GUI guide set on proportional. I see there is a resizeFcn option. How do I set it, so that it would maintain maximized?

I have Windows 7 64x and MatLab R2011a.

I have multiple buttons on my GUI, so when I click on maximize icon it maximizes. Every button pressed works OK, but when I hit on refresh it exits maximize state and shifts a bit.

When I run it, it displays a window in the center of the screen.

The refresh button is the same if you use GUIDE's template Axes and Menu.

## Naz

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/24499#comment_54070

Set the 'units' property of all objects to 'normalized'. Hopefully that will help

## Slobodan Djordjevi?

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/24499#comment_54100

Nope, does not do the trick! Thanks anyways :)