Merging existing subplots into a single one

조회 수: 46 (최근 30일)
HWIK
HWIK 2021년 4월 16일
댓글: HWIK 2021년 4월 16일
Lets say I have two subplots, both of dimensions (2,1), saved as matlab figures. Is there any way for me to merge them into a single subplot figure of dimensions (2,2)?
  댓글 수: 2
João Mendes
João Mendes 2021년 4월 16일
Hi, for two images, maybe try the imshowpair function. For two plots, you can try to use the hold on command.
Tell me if it helps,
J.
HWIK
HWIK 2021년 4월 16일
Unfortunately not, but thanks for the suggestion!

댓글을 달려면 로그인하십시오.

채택된 답변

Rik
Rik 2021년 4월 16일
This is a surprisingly difficult task. You will have to copy all objects to the same figure and adapt the Position properties of all children of the two figures. I doubt calls like subplot(2,2,__) are going to work after that.
It is often easier to make sure your plotting code accepts an axes handle as input. That way your plotting code is not dependent on the surrounding figure, making it much easiers to copy all objects over.
  댓글 수: 4
HWIK
HWIK 2021년 4월 16일
Sure, considering these are the figures I want to merge: 'left.fig' & 'right.fig'. They look like this:
Sorry, but I'm not sure I have the Matlab knowledge to execute your explanation, yet! : D
HWIK
HWIK 2021년 4월 16일
Actually, just found this function. Does it pretty well, but thank though

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by