Decrease Existing UIGridLayout RowHeight (or ColumnWidth)
I’m trying to decrease an existing uigridlayout’s number of rows and columns. Below I created the figure and grid.
fig = uifigure; % make uifigure
g = uigridlayout(fig); % put uigridlayout in fig
g.RowHeight = {‘1x’ ‘1x’ ‘1x’ ‘1x’}; % assign to uigridlayout 4 rows
g.ColumnWidth = {‘1x’ ‘1x’}; % assign to uigridlayout 2 columns
So, it already exists and has a specified row height and column width dimensions. And I want to change the number of rows and columns in this existing uigridlayout (g)… instead of deleting it and making a new one with the desired number of rows and columnns (e.g. a grid with 3 rows and 3 columns).
I am able to add rows or columns –>
g.ColumnWidth = {‘1x’ ‘1x’ ‘1x’} % assign greater amount of columns to g.ColumnWidth property
output –>
g =
GridLayout with properties:
RowHeight: {‘1x’ ‘1x’ ‘1x’ ‘1x’}
ColumnWidth: {‘1x’ ‘1x’ ‘1x’}
But I can’t seem to be able to remove rows or columns –>
g.RowHeight = {‘1x’ ‘1x’ ‘1x’} % assign lower amount of columns to g.RowHeight property
output –>
g =
GridLayout with properties:
RowHeight: {‘1x’ ‘1x’ ‘1x’ ‘1x’}
ColumnWidth: {‘1x’ ‘1x’ ‘1x’}
How do I decrease the number of rows or columns in this existing uigridlayout?I’m trying to decrease an existing uigridlayout’s number of rows and columns. Below I created the figure and grid.
fig = uifigure; % make uifigure
g = uigridlayout(fig); % put uigridlayout in fig
g.RowHeight = {‘1x’ ‘1x’ ‘1x’ ‘1x’}; % assign to uigridlayout 4 rows
g.ColumnWidth = {‘1x’ ‘1x’}; % assign to uigridlayout 2 columns
So, it already exists and has a specified row height and column width dimensions. And I want to change the number of rows and columns in this existing uigridlayout (g)… instead of deleting it and making a new one with the desired number of rows and columnns (e.g. a grid with 3 rows and 3 columns).
I am able to add rows or columns –>
g.ColumnWidth = {‘1x’ ‘1x’ ‘1x’} % assign greater amount of columns to g.ColumnWidth property
output –>
g =
GridLayout with properties:
RowHeight: {‘1x’ ‘1x’ ‘1x’ ‘1x’}
ColumnWidth: {‘1x’ ‘1x’ ‘1x’}
But I can’t seem to be able to remove rows or columns –>
g.RowHeight = {‘1x’ ‘1x’ ‘1x’} % assign lower amount of columns to g.RowHeight property
output –>
g =
GridLayout with properties:
RowHeight: {‘1x’ ‘1x’ ‘1x’ ‘1x’}
ColumnWidth: {‘1x’ ‘1x’ ‘1x’}
How do I decrease the number of rows or columns in this existing uigridlayout? I’m trying to decrease an existing uigridlayout’s number of rows and columns. Below I created the figure and grid.
fig = uifigure; % make uifigure
g = uigridlayout(fig); % put uigridlayout in fig
g.RowHeight = {‘1x’ ‘1x’ ‘1x’ ‘1x’}; % assign to uigridlayout 4 rows
g.ColumnWidth = {‘1x’ ‘1x’}; % assign to uigridlayout 2 columns
So, it already exists and has a specified row height and column width dimensions. And I want to change the number of rows and columns in this existing uigridlayout (g)… instead of deleting it and making a new one with the desired number of rows and columnns (e.g. a grid with 3 rows and 3 columns).
I am able to add rows or columns –>
g.ColumnWidth = {‘1x’ ‘1x’ ‘1x’} % assign greater amount of columns to g.ColumnWidth property
output –>
g =
GridLayout with properties:
RowHeight: {‘1x’ ‘1x’ ‘1x’ ‘1x’}
ColumnWidth: {‘1x’ ‘1x’ ‘1x’}
But I can’t seem to be able to remove rows or columns –>
g.RowHeight = {‘1x’ ‘1x’ ‘1x’} % assign lower amount of columns to g.RowHeight property
output –>
g =
GridLayout with properties:
RowHeight: {‘1x’ ‘1x’ ‘1x’ ‘1x’}
ColumnWidth: {‘1x’ ‘1x’ ‘1x’}
How do I decrease the number of rows or columns in this existing uigridlayout? uifigure, uigridlayout, rows and columns, editing properties MATLAB Answers — New Questions