Legend not matching the data
Show older comments
I have weird data and not enough time to figure out the for loop stuff, so I did a basic plotting thing. But the legend is not matching my data. Is it the size of the legend or something?

j1 = plot(temp2412,original2412(:,1),'-o','Color',C6,'LineWidth',lw,'MarkerSize',ms,'MarkerEdgeColor',C6,'MarkerFaceColor',C6);
hold on
j2 = plot(temp2412,original2412(:,2),'-o','Color',C1,'LineWidth',lw,'MarkerSize',ms,'MarkerEdgeColor',C1,'MarkerFaceColor',C1);
j3 = plot(temp2412,original2412(:,3),'-o','Color',C3,'LineWidth',lw,'MarkerSize',ms,'MarkerEdgeColor',C3,'MarkerFaceColor',C3);
j4 = plot(temp3624,original3624(:,1),'-o','Color',C8,'LineWidth',lw,'MarkerSize',ms,'MarkerEdgeColor',C8,'MarkerFaceColor',C8);
j5 = plot(temp3018,original3018(:,1),'-o','Color',C10,'LineWidth',lw,'MarkerSize',ms,'MarkerEdgeColor',C10,'MarkerFaceColor',C10);
j6 = plot(temp2412,aged2412(:,1),'--o','Color',C6,'LineWidth',lw,'MarkerSize',ms,'MarkerEdgeColor',C6,'MarkerFaceColor',C6);
j7 = plot(temp2412,aged2412(:,2),'--o','Color',C1,'LineWidth',lw,'MarkerSize',ms,'MarkerEdgeColor',C1,'MarkerFaceColor',C1);
j8 = plot(temp2412,aged2412(:,3),'--o','Color',C3,'LineWidth',lw,'MarkerSize',ms,'MarkerEdgeColor',C3,'MarkerFaceColor',C3);
j9 = plot(temp3624,aged3624(:,1),'--o','Color',C8,'LineWidth',lw,'MarkerSize',ms,'MarkerEdgeColor',C8,'MarkerFaceColor',C8);
j10 = plot(temp3624,aged3624(:,2),'--o','Color',C10,'LineWidth',lw,'MarkerSize',ms,'MarkerEdgeColor',C10,'MarkerFaceColor',C10);
leg = [j1,j2,j3,j4,j5,j6,j7,j8,j9,j10];
xlim([-40 -6])
ylim([0 700]);
xlabel('Temperature (°C)','FontSize',fontsize);
ylabel('Stiffness (MPa)','FontSize',fontsize);
set(gca,'fontsize',22);
grid on
ax = gca;
legend(leg,'PEN 70/100 O','S-E1 O','S-E2 O','S-R1 O','S-R2 O','PEN 70/100 A','S-E1 A','S-E2 A','S-R1 A','S-R2 A');
Accepted Answer
More Answers (0)
Categories
Find more on Legend 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!
