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

2 ビュー (過去 30 日間)
Erez
Erez 2018 年 8 月 5 日
編集済み: Erez 2018 年 8 月 6 日
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 Center および File ExchangeSpecifying Target for Graphics Output についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by