Axes在MATLAB GUI中占据整个屏幕

问题描述 投票:1回答:2

必须有一个简单的答案。经过大量的搜索,我找不到合适的回答。

这就是我想要使用GUIDE工具制作的内容。

这就是我得到的。 (注意:使用子图功能绘制图)

我究竟做错了什么?该图不应该简单地适合GUIDE界面中预定义的'axes1'矩形吗?

matlab user-interface resize axes
2个回答
1
投票

我解决这个问题的方法是将轴放在一个单独的面板上,从而将它们限制在面板的大小。希望能帮助到你!

PS:我也在使用subplot


0
投票

如果在GUI中使用subplot函数,它将覆盖使用GUIDE定义的轴。相反,最好绘制两个独立的轴。

%this will plot axes 1    
axes(handles.axes1)
plot(x,y)
title('Title of Axes 1'
ylabel('y Label of Axes 1')
xlabel('x Label of Axes 1')

%this will plot axes 2
axes(handles.axes2)
plot(x,y)
title('Title of Axes 2'
ylabel('y Label of Axes 2')
xlabel('x Label of Axes 2')
© www.soinside.com 2019 - 2024. All rights reserved.