Changing the colour of data points on a graph that satisfy a certain criteria
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
So i basically calculate a probability and for data points that have a probability of say 0.8 i want to change the colour on the graph, what function do i use to do this? i have tried using the set function but dont seem to be able to get it to work
0 commentaires
Réponses (1)
bym
le 3 Nov 2012
There are many ways of doing this. Here is one
clear;clc
x = rand(2000,1);
y = rand(2000,1);
c = hypot(x -.5,sqrt(y)-1.25*y) > .2;
plot(x(c),y(c),'b.',x(~c),y(~c),'r*')
axis square
Voir également
Catégories
En savoir plus sur Signal Generation and Preprocessing 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!