tags:

views:

337

answers:

1

I am developing a GUI frontend application in MATLAB. It's becoming quite complex these days, but as a showcase of the problem I'm having, I created a simple GUI containing an axes and a button. I display a surf(peaks) plot in the axes, and the buttonpress adds a colorbar('location','southoutside') to the plot. The axes stretch and overlap the boundaries I set for the object in GUIDE. Resizing them via set(handles.axes1,'Position',[...]) doesn't help. Any insights on how to compensate for this will be greatly appreciated.

As a side note, I'd like to add that maintaining an ever-growing application (especially a graphically-oriented one) in MATLAB is absolutely tedious if you want the widgets to do some more complex stuff. Great for creating something simple quickly, but don't get stuck building on that it if you can...

+3  A: 

Apparently there's a property for the axes widget called OuterPosition which defines the extents of the axes containing all other objects surrounding the axes (labels, ticks, colorbar). Setting the ActivePositionProperty property to 'outerposition' causes the position to be preserved during scaling to be the outer position. Also, setting the Units property to 'normalized' allows for automatic scaling with respect to resizing the window. Oh joy. ;)

neuviemeporte