Merge two figures into one
조회 수: 3 (최근 30일)
이전 댓글 표시
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;
%
%
채택된 답변
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;
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!