Merge two figures into one
3 views (last 30 days)
Show older comments
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;
%
%
Accepted Answer
Walter Roberson
on 5 Mar 2021
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;
More Answers (0)
See Also
Categories
Find more on Graphics Object Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!