Normalize uifigure units in R2019b
이전 댓글 표시
Hi,
I have been trying to get the units of a uifigure to be set to normalized but cannot for the life of me find a way to do it.
On the uifigure documentation it only lists the units as being set as pixels
Would that mean that I cannot set the units of a uifigure, and subsequently children within it, to normalized? It seems like it should be possible to set the units to normalized given a standard figure can have normalized units.
Main reason for wanting to use a uifigure over a normal figure is just that the uitable that I'm putting in the figure has nicer styling in a uifigure than a normal figure and allows for highlighting of entire rows and columns with one click.
In testing I have been following the example here: https://uk.mathworks.com/matlabcentral/answers/254690-how-can-i-display-a-matlab-table-in-a-figure?s_tid=srchtitle
(code below)
Thanks!
LastName = {'Smith';'Johnson';'Williams';'Jones';'Brown'};
Age = [38;43;38;40;49];
Height = [71;69;64;67;64];
Weight = [176;163;131;133;119];
T = table(Age,Height,Weight,'RowNames',LastName);
% fig = uifigure; % toggle fig to be part of the script and in the properties of uitable (uitable(fig, .....))
uitable('Data',T{:,:},'ColumnName',T.Properties.VariableNames,...
'RowName',T.Properties.RowNames, 'Units', 'Normalized', 'Position', [0.1 0.1 0.8 0.8]);
답변 (1개)
Walter Roberson
2021년 1월 29일
0 개 추천
Would that mean that I cannot set the units of a uifigure, and subsequently children within it, to normalized?
It means that you cannot set the units of the uifigure() to Normalized, but you can still set the units of children of uifigure to be normalized.
댓글 수: 3
Tristan Thompson
2021년 1월 29일
Walter Roberson
2021년 1월 29일
Your code works in MATLAB Online, which is running R2020b. Perhaps you are using an older release?
Tristan Thompson
2021년 1월 29일
카테고리
도움말 센터 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
