How do we concatenate two imagesc figures ( 2D matrix) into one figure ( one below the other stacked) without any gaps?

5 ビュー (過去 30 日間)
I have two figures (Fig1 and Fig2): They are two separate imagesc plots.
How do i get a plot of concatenated version of these two plots as shown in concatenated.png( attached) ?
There should not be any gaps between the two plots as we obain in subplot.
code:
figure(4);
imagesc(Rng,Vel,RDM_1);
xlabel('---> Range (m)');ylabel('---> Velocity (m/s)')
title('Range-Doppler Map 1');
figure(5);
imagesc(Rng,Vel,RDM_2);
xlabel('---> Range (m)');ylabel('---> Velocity (m/s)')
title('Range-Doppler Map 2');
I need to concatenate the 2D matrix RDM_1 and RDM_2 one below the other without any gap ( as shown in concatenate.png).
  4 件のコメント
Walter Roberson
Walter Roberson 2021 年 9 月 21 日
I suggest using linkaxes() to ensure the x axes are the same.

サインインしてコメントする。

採用された回答

Harikrishnan Balachandran Nair
Harikrishnan Balachandran Nair 2021 年 9 月 21 日
I understand that you are trying to have two 'imagesc' plots stacked vertically, without any gap in between them.
A Possible workaround for this would be to have two 'axes' object defined on the same 'figure' handle , positioned in such a way that they are stacked vertically without any gap in between.
This can be done by adjusting the 'Position' property of the axes object.You can refer to the following code for the same.
fig=figure;
axes1=axes(fig);
axes2=axes(fig);
axes1.Position(1,4)=axes1.Position(1,4)/2;
axes2.Position(1,4)=axes2.Position(1,4)/2;
axes2.Position(1,2)= axes1.Position(1,2)+axes1.Position(1,4);
imagesc(axes1,Rng,Vel,RDM_1);
imagesc(axes2,Rng,Vel,RDM_2);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Clutter についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by