Normalize uifigure units in R2019b
Afficher commentaires plus anciens
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]);
Réponses (1)
Walter Roberson
le 29 Jan 2021
0 votes
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 commentaires
Tristan Thompson
le 29 Jan 2021
Walter Roberson
le 29 Jan 2021
Your code works in MATLAB Online, which is running R2020b. Perhaps you are using an older release?
Tristan Thompson
le 29 Jan 2021
Catégories
En savoir plus sur Develop Apps Using App Designer dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
