如何解决有没有办法在 MATLAB App Designer UIAxes 中显示箱线图?
我正在寻找一种在 UIAxes 箱线图中显示的方法。我考虑将绘图保存为 .png 格式,然后使用 MATLAB 的 imshow 函数。但是我更愿意避免这个过程,因为结果不是最好的。
解决方法
UIAxes 上的箱线图(以编程方式)
通过将坐标区对象作为 uiaxes
函数调用的第一个参数传递,可以在一组 boxplot()
上绘制箱线图。在本例中,我通过调用 load carsmall
使用内置于 MATLAB 中的数据。 uiaxes
(UIAxes
) 的父级是 uifigure
(App
)。
%App figure properties%
App = uifigure();
App.Name = "GUI";
X_Position = 200; Y_Position = 200;
Height = 300; Width = 600;
App.Position = [X_Position Y_Position Width Height];
UIAxes = uiaxes(App);
%Using built-in sample data to create boxplot%
load carsmall
boxplot(UIAxes,MPG,Origin);
X_Position = 100; Y_Position = 20;
Height = 250; Width = 400;
UIAxes.Position = [X_Position Y_Position Width Height];
UIAxes.XLabel.String = 'Country of Origin';
UIAxes.YLabel.String = 'Miles per Gallon (MPG)';
UIAxes.Title.String = 'Miles per Gallon by Vehicle Origin';
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。