Merge two figures into one

1 回表示 (過去 30 日間)
Brave A
Brave A 2021 年 3 月 4 日
コメント済み: Brave A 2021 年 3 月 5 日
Hi,
I have two figures thier lines similar to each other, I want them in one figure. what is the good ways to represent them in one figure with 6 lines? Note: the last line is the same for each then it will overlapping in a new figure.
thanks in advance!
clear;
%%%%Actual values%%%
figure;
clf('reset');
TextFontSize=20;
LegendFontSize = 18;
set(0,'DefaultAxesFontName','Times',...
'DefaultLineLineWidth',1,...
'DefaultLineMarkerSize',8);
set(gca,'FontName','Times New Roman','FontSize',TextFontSize);
x=[5,6,7,8,9,10,11]; %
plot(x,[113,117,123,133,142,148,153], 'b:x',...
'LineWidth',1,...
'MarkerSize',7,...
'MarkerEdgeColor','b',...
'MarkerFaceColor',[0.5,0.5,0.5]); %L
hold on;
plot(x,[56,63,76,91,101,112,118], '--k*',...
'LineWidth',1,...
'MarkerSize',7,...
'MarkerEdgeColor','k',...
'MarkerFaceColor',[0.5,0.5,0.5]); % C
hold on;
plot(x,[38,48,61,75,89,102,110], '-.hr',...
'LineWidth',1,...
'MarkerSize',7,...
'MarkerEdgeColor','r',...
'MarkerFaceColor',[0.5,0.5,0.5]); % F
set(gca,'XMinorTick','on','YMinorTick','on');
grid on;
xlabel('System ')
ylabel('Selected Number ')
legend('L','C','F')
hold off;
%%%%% Before Actual values
figure;
clf('reset');
TextFontSize=20;
LegendFontSize = 18;
set(0,'DefaultAxesFontName','Times',...
'DefaultLineLineWidth',1,...
'DefaultLineMarkerSize',8);
set(gca,'FontName','Times New Roman','FontSize',TextFontSize);
x=[5,6,7,8,9,10,11];
plot(x,[114,118,124,134,142,149,153], 'b:x',...
'LineWidth',1,...
'MarkerSize',7,...
'MarkerEdgeColor','b',...
'MarkerFaceColor',[0.5,0.5,0.5]); %L
hold on;
plot(x,[118,125,128,140,148,152,160], '--k*',...
'LineWidth',1,...
'MarkerSize',7,...
'MarkerEdgeColor','k',...
'MarkerFaceColor',[0.5,0.5,0.5]); % C
hold on;
plot(x,[38,48,61,75,89,102,110], '-.hr',...
'LineWidth',1,...
'MarkerSize',7,...
'MarkerEdgeColor','r',...
'MarkerFaceColor',[0.5,0.5,0.5]); % F
set(gca,'XMinorTick','on','YMinorTick','on');
grid on;
xlabel('System ')
ylabel('Selected Number of Users')
legend('L','C','F')
hold off;
%
%
  1 件のコメント
Brave A
Brave A 2021 年 3 月 5 日
Any thoghts?

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2021 年 3 月 5 日
TextFontSize=20;
LegendFontSize = 18;
set(0,'DefaultAxesFontName','Times',...
'DefaultLineLineWidth',1,...
'DefaultLineMarkerSize',8);
set(gca,'FontName','Times New Roman','FontSize',TextFontSize);
x=[5,6,7,8,9,10,11]; %
plot(x,[113,117,123,133,142,148,153], 'b:x',...
'LineWidth',1,...
'MarkerSize',7,...
'MarkerEdgeColor','b',...
'MarkerFaceColor',[0.5,0.5,0.5], 'DisplayName', 'L1'); %L
hold on;
plot(x,[56,63,76,91,101,112,118], '--k*',...
'LineWidth',1,...
'MarkerSize',7,...
'MarkerEdgeColor','k',...
'MarkerFaceColor',[0.5,0.5,0.5], 'DisplayName', 'C1'); % C
plot(x,[38,48,61,75,89,102,110], '-.hr',...
'LineWidth',1,...
'MarkerSize',7,...
'MarkerEdgeColor','r',...
'MarkerFaceColor',[0.5,0.5,0.5], 'DisplayName', 'F1'); % F
x=[5,6,7,8,9,10,11];
plot(x,[114,118,124,134,142,149,153], 'b:o',...
'LineWidth',1,...
'MarkerSize',7,...
'MarkerEdgeColor','b',...
'MarkerFaceColor',[0.5,0.5,0.5], 'DisplayName', 'L2'); %L
plot(x,[118,125,128,140,148,152,160], '--kv',...
'LineWidth',1,...
'MarkerSize',7,...
'MarkerEdgeColor','k',...
'MarkerFaceColor',[0.5,0.5,0.5], 'DisplayName', 'C2'); % C
plot(x,[38,48,61,75,89,102,110], '-.^r',...
'LineWidth',1,...
'MarkerSize',7,...
'MarkerEdgeColor','r',...
'MarkerFaceColor',[0.5,0.5,0.5], 'DisplayName', 'F2'); % F
set(gca,'XMinorTick','on','YMinorTick','on');
grid on;
xlabel('System ')
ylabel('Selected Number of Users')
legend show
hold off;
  1 件のコメント
Brave A
Brave A 2021 年 3 月 5 日
Big Thanks Walter

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by