在同一图中显示多个uitable对象? [英] Display multiple uitable objects in the same figure?

查看:119
本文介绍了在同一图中显示多个uitable对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在同一个MATLAB图中显示几个表,与可以使用子图显示多个图的方法相同.但是,子图似乎不适用于可使用的对象.

I would like to display several tables in the same MATLAB figure, much the same as subplot can be used to display multiple graphs. However, it seems that subplot does not apply to uitable objects.

如您所见,我得到的是五套空轴,而不是整个图中分布的五张表.

As you can see, instead of five tables distributed across the figure, I am getting five sets of empty axes, and only one of the tables is visible.

在MATLAB中有没有办法做到这一点?

Is there a way to do this in MATLAB?

应用下面提供的答案会更好!

Much better after applying the answer supplied below!

推荐答案

uitable的父项是图形或uipanel本身.因此,您可以使用表格单位和位置属性来手动设置表格在图形或uipanel中的位置.如果tt=uitable(...)创建的表的句柄,则可以使用set(t,'units'...)set(t,'position',[left buttom widht height])适当地定位表.

The parent of a uitable is a figure or uipanel itself. So, you can use the tables units and position properties to manually set the tables position within the figure or uipanel. If t is the handle to a table created by t=uitable(...) then you can use set(t,'units'...) and set(t,'position',[left buttom widht height]) to position the table appropriately.

这是一个具体示例

f=figure
dd=rand(5,4); %# data
colnames = {'1' '2' '3' 'weight'}
for i=1:4
    t(i) = uitable(f,'columnname',colnames, ...
                     'data',dd, ...
                     'units','normalized', ...
                     'pos',[(i-1)/4 0 .25 1])
end

这篇关于在同一图中显示多个uitable对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆