开发者

MATLAB GUI axes break window layout

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 applicatio开发者_开发问答n (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...


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. ;)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜