Changing the colour of data points on a graph that satisfy a certain criteria
1 view (last 30 days)
Show older comments
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 Comments
Answers (1)
bym
on 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
See Also
Categories
Find more on Signal Generation and Preprocessing 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!