creating line plot with different marker color and legends
Afficher commentaires plus anciens
Hi,
I have data stored in two arrays as follows.
A = [10.15 , 10.92, 11.81,12.83]
B = [3.92, 9.18, 14.87, 18.14].
I am creating plot using the below shown script. Here, I would like to create line plot with different marker colors and also the legends. I can able to generate different marker color and legends, but not with the line. Is there any way to create line plot with this ??
plot (A (1,1), B(1,1), '*','color', 'b','markersize',20);
hold on
plot (A (2,1), B(2,1), '*','color', 'r','markersize',20);
hold on
plot (A (3,1), B(3,1), '*','color', 'g','markersize',20);
hold on
plot (A (4,1), B(4,1), '*','color', 'm','markersize',20);
hold on
set (gca, 'Linewidth', 2);
set(gca, 'FontSize', 18)
set(gca,'TickLabelInterpreter','latex')
legend({'$\alpha_{a}=0$','$\alpha_{b}=0.1$','$\alpha_{c}=0.2$','$\alpha_{d}=0.3$'},'Interpreter','latex');
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Legend dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

