I have a gridded figure with 2 "game boards" , but they don't look the same
4 ビュー (過去 30 日間)
古いコメントを表示
I have the following code to plot a figure with 2 game boards, for a battleship game:
subplot( 2, 1, 1 );
set( gca, 'XTickLabel', '', 'YTickLabel', '', 'BoxStyle', 'full' );
title( 'Computer Board' );
axis square
subplot( 2, 1, 2 );
axis square
set( gca, 'XTickLabel', '', 'YTickLabel', '', 'BoxStyle', 'full' );
title( 'Your Board' );
But the board appears as in the attached picture, so how can i make them both look the same, also how can i make both a bit bigger.
0 件のコメント
採用された回答
Image Analyst
2022 年 1 月 2 日
Maybe try calling xlim and ylim after you call axis on each. Like maybe
xlim([0.5, 6.5]);
ylim([0.5, 6.5]);
or
xlim([1 6]);
ylim([1 6]);
4 件のコメント
Image Analyst
2022 年 1 月 3 日
ax = gca;
ax.Units = 'normalized';
ax.Position = [xLeft, yTop, width, height];
Set all values in the range 0 to 1.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!