Combine two existing Matlab figs, into one figure with two y axes (keeping the respective axes titles and units)

조회 수: 2 (최근 30일)
Hi, I have two Matlab figs, although not the original data in a *.mat file, which share the same 'x' axis, but not 'y' (one curve in each figure). I wish to combine Fig. 2 into Fig, 1, but have two y axes, with the original axis titles and units. I also wish to keep the original symbols and the same color map for the curves from the two pictures. What is the easiest way to do that?
Thank you.
  댓글 수: 4
dpb
dpb 2018년 8월 5일
편집: dpb 2018년 8월 5일
I think I mistyped/misnamed the new world replacement for the deprecated plotyy :)
-- it's |yyaxis| instead. Sorry...
ADDENDUM
I did just try a 'spearmint; took the example for two axes and created two figures instead of the L/R axes. Then with some rigamarole to get all the necessary handles to the lines that are children of their respective axes,
yyaxis left
hAxL=gca;
copyobj(hL1,hAxL)
yyaxis right
hAxR=gca;
copyobj(hL2,hAxR)
did bring over the line colors, markers, etc., ... I didn't experiment with the titles and all, but the basic operations seems to work ok.
Erez
Erez 2018년 8월 6일
편집: Erez 2018년 8월 6일
Thanks a lot, but unfortunately it still doesn't work. Ok, I've copied your exact code. I also had a mistake, I am using Matlab 2014b, so maybe this version is not familiar with this syntax. The error message is:
"Undefined function 'yyaxis' for input arguments of
type 'char'.
Did you mean:
>> axis left "
Perhaps there is a way to download the function `yyaxis' and add it into my script?

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

답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by