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!