How do I combine 3 figures into a single plot and compare them?

조회 수: 9 (최근 30일)
Marco Bozic
Marco Bozic 2022년 7월 29일
댓글: Rohit 2022년 10월 6일
I have 3 temperature plots of a certain fixed setup. Each temperature plot has the same general shape, just the temperature varies as the heat generated is different for each plot. I now wish to compare them in a single plot using subplots. I tried the following: https://ch.mathworks.com/matlabcentral/answers/523200-combine-fig-files-into-1-figure
yet this is not what I need, as it only places the figures in certain subplots and since they look virtually the same, I am unable to compare them.
I hope I am making sense.
  댓글 수: 2
Adam Danz
Adam Danz 2022년 8월 1일
Welcome to the forum Marco. Is the problem that you can't compare the different subplot or is the problem that they all look similar and you don't know which is which? If the problem is the latter, you can add titles to the subplots. Or, would you like to add all of the data into a single axes for direct comparsion?
I'm not quite sure what the goal or problem is.
Rohit
Rohit 2022년 10월 6일
Hi,
If you do not have the MATLAB code for the figures and just have the .FIG files, you can refer to the MATLAB Answers link below to help you extract data from .FIG files. Thereafter, you can follow the suggested answer by Matt J to combine 3 figures into a single plot. That should be a better way to compare the 3 temperature plots.

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

답변 (1개)

Matt J
Matt J 2022년 8월 1일
편집: Matt J 2022년 8월 1일
Perhaps this is what you mean. Start with 3 plots,
colors={'r','g','m'}
colors = 1×3 cell array
{'r'} {'g'} {'m'}
for i=1:3
figure(i);
h(i)=plot((0:4)+i,colors{i}); ylim([0,5])
end; drawnow
then copy all of the lines to a common axis:
figure(4);
Hax=axes;
copyobj(h,Hax);

카테고리

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