scatter function for different colors
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
sermet
le 19 Fév 2015
Modifié(e) : Michael Haderlein
le 19 Fév 2015
txt1=[{'A100'};{'B100'};{'C100'};{'X1'};{'X2'}];
y=[100;150;200;135;140];
x=[200;250;300;225;235];
figure(1),scatter(y, x, 'b^');grid off;
text(y, x, txt1);
title('points')
xlabel('Y');
ylabel('X');
line(y,x,'Color','k','LineWidth',1);
%I need to make X1 and X2 red in the figure1 while the other points are black.
0 commentaires
Réponse acceptée
Michael Haderlein
le 19 Fév 2015
Modifié(e) : Michael Haderlein
le 19 Fév 2015
txt1=[{'A100'};{'B100'};{'C100'};{'X1'};{'X2'}];
y=[100;150;200;135;140];
x=[200;250;300;225;235];
% size|color in rgb | marker
figure(1),scatter(y, x, 36, [zeros(numel(y)-2,3);1 0 0;1 0 0], '^');grid off;
text(y, x, txt1);
title('points')
xlabel('Y');
ylabel('X');
line(y,x,'Color','k','LineWidth',1);
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Predictive Maintenance Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!