Changing the colour of data points on a graph that satisfy a certain criteria
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
bym
el 3 de Nov. de 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
Ver también
Categorías
Más información sobre Signal Generation and Preprocessing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!