- Use the ‘uifigure’ and ‘uitable’ to add the table.
- After creating the table use ‘uistyle’ to center the data entries. Refer the following MATLAB Answer : https://in.mathworks.com/matlabcentral/answers/488135-how-to-change-horizontal-alignment-left-right-center-of-entries-in-a-uitable
- To add the ‘subplot’ in the ‘uifigure’, refer to the following MATLAB Answer - https://in.mathworks.com/matlabcentral/answers/1852898-how-to-use-subplot-in-a-uifigure
- If you want to save the figure, refer this MATLAB Answer - https://in.mathworks.com/matlabcentral/answers/406897-how-to-save-uitable-uifigure-into-pdf-file
Centering data in uitable without using uifigure?
조회 수: 1 (최근 30일)
이전 댓글 표시
I need to center the data in my table without using the uifigure function as I am placing the uitable and a plot on the same figure using subplots and then later outputting to a pdf.
Any help appreciated!
Data = cellstr(string([xPosRound yPosRound jbChngRound jbDistBtwnRound]));
format default
m = 6;
figure
hAx=subplot(m,m,[7 8 9 13 14 15 19 20 21 25 25 27 31 32 33]);
hUI=uitable('Data',Data, ...
'ColumnName',["X" "Y" "Chainage" "Distance"],...
'RowName',row_array', ...
'Units', ...
'Normalized', ...
'Position',hAx.Position); axis off
hAy=subplot(m,m,[10 11 12 16 17 18 22 23 24 28 29 30 34 35 36]);
plot(xPos,yPos,'bo',x,y,'r'); axis padded equal
hAz = subplot(m,m,[3 4]);
imshow('mwp.jpg')
set(gcf, 'Position',[100 500 1040 800])
댓글 수: 0
답변 (1개)
Sachin
2023년 9월 11일
Hi Jordan,
I understand that you want to centrethe data in the table without using the ‘uifigure’ function.
There are some limitations when using 'figure'. I suggest you to use 'uifigure' to work with your workflow. A possible workaround that might be helpful to you when using the ‘uifigure’:
I hope these suggestions helps in resolving the issues you are facing.
Thanks
Sachin
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop uifigure-Based Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!