how to merge two figures
14 ビュー (過去 30 日間)
古いコメントを表示
Good morning sir
i have attached two figures.i requesting you please help me how to merge two figures
0 件のコメント
回答 (3 件)
Stephan
2022 年 5 月 9 日
Have a look at: yyaxis
2 件のコメント
Pavl M.
2024 年 11 月 26 日 20:04
編集済み: Pavl M.
2024 年 11 月 26 日 20:37
How to license codes?
Better than Creative Commons?
Have you already embedded codes in the .fig files?
clc
clear all
close all
f1 = openfig('https://uk.mathworks.com/matlabcentral/answers/uploaded_files/991995/figure(1).fig','invisible')
f2 = openfig('https://uk.mathworks.com/matlabcentral/answers/uploaded_files/992000/figure(2).fig','invisible')
o1=findobj(f1,'Type','line');
x_f1=get(o1,'xdata');
y_f1=get(o1,'ydata');
o2=findobj(f2,'Type','line');
x_f2=get(o2,'xdata');
y_f2=get(o2,'ydata');
figure
yyaxis left
plot(x_f1,y_f1)
hold on
yyaxis right
plot(x_f2,y_f2)
hold off
title('Combined figures')
%Constructed by
%https://independent.academia.edu/PMazniker
%+380990535261, https://join.skype.com/invite/oXnJhbgys7oW
%https://diag.net/u/u6r3ondjie0w0l8138bafm095b
%https://github.com/goodengineer
%https://orcid.org/0000-0001-8184-8166
%https://willwork781147312.wordpress.com/portfolio/cp/
%https://www.youtube.com/channel/UCC__7jMOAHak0MVkUFtmO-w
%https://nanohub.org/members/130066
%https://pangian.com/user/hiretoserve/
%https://substack.com/profile/191772642-paul-m
Pavl M.
2024 年 11 月 26 日 20:15
編集済み: Pavl M.
2024 年 11 月 26 日 20:35
How to license codes?
My codeworks programme are on Specific ECommerce License.
Have you already embedded codes in the .fig files?
clc
clear all
close all
%Since there are a few plots in figure with y axis "Infected", need
%to extract all children from it (object oriented, standard GUI feature
%like in Qt framework, using the class getters...doable...just need
%more time and investment to finish the yet commented codes.
open https://uk.mathworks.com/matlabcentral/answers/uploaded_files/992000/figure(1).fig;
fig = get(groot, 'CurrentFigure' )
hFigAxes = get(fig,'Children')
h1Plot = get(hFigAxes,'Children')
x1Data = get(h1Plot,'XData')
y1Data = get(h1Plot,'YData')
close(fig)
f2 = openfig('https://fr.mathworks.com/matlabcentral/answers/uploaded_files/991995/figure(2).fig','invisible')
o2=findobj(f2,'Type','line');
x_f2=get(o2,'xdata');
y_f2=get(o2,'ydata');
figure
yyaxis left
plot(x1Data{1},y1Data{1})
hold on
plot(x1Data{2},y1Data{2})
hold on
yyaxis right
plot(x_f2,y_f2)
hold off
title('Combined Figures')
%Constructed by
%https://independent.academia.edu/PMazniker
%+380990535261, https://join.skype.com/invite/oXnJhbgys7oW
%https://diag.net/u/u6r3ondjie0w0l8138bafm095b
%https://github.com/goodengineer
%https://orcid.org/0000-0001-8184-8166
%https://willwork781147312.wordpress.com/portfolio/cp/
%https://www.youtube.com/channel/UCC__7jMOAHak0MVkUFtmO-w
%https://nanohub.org/members/130066
%https://pangian.com/user/hiretoserve/
%https://substack.com/profile/191772642-paul-m
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!