How to determine the different colour in scatter plot?
Show older comments
Hi Everybody,
Could you please help me how I can show it with different color? refer to the below code? this code show in one color while I need to determine different satellite by different color.
17 Comments
Walter Roberson
on 13 Dec 2012
Why are you bothering to compute y, as you are not using it?
You are placing the circles in the same place each time, just with different sizes.
Ara
on 13 Dec 2012
Edited: Walter Roberson
on 13 Dec 2012
Azzi Abdelmalek
on 13 Dec 2012
Edited: Azzi Abdelmalek
on 13 Dec 2012
You are just erasing the previous scatter. What you can do is to scatter the biggest circle then the smallest
Walter Roberson
on 13 Dec 2012
You are plotting two circles of the same size at the same location. Only the second one is going to show up.
Walter Roberson
on 17 Dec 2012
idx = s4_0(1,:) >= 0.2;
scatter(longi(idx), lati(idx), s4_0(1,idx)*2500,'r');
Ara
on 17 Dec 2012
Walter Roberson
on 17 Dec 2012
Please show min(S4_0(1,:)) and max(S4_O(1,:))
Ara
on 19 Dec 2012
Walter Roberson
on 19 Dec 2012
My previous code
idx = s4_0(1,:) >= 0.2;
scatter(longi(idx), lati(idx), s4_0(1,idx)*2500,'r');
does use different radius of the circle. The s4_0(1,idx)*2500 expression is in the point-size parameter location, and the idx is selecting only those locations with the minimum radius.
But are you sure that the min() and max() are the same value ? Please show
format long g
min(S4_0(1,:))
max(S4_0(1,:))
Ara
on 19 Dec 2012
Walter Roberson
on 19 Dec 2012
If all of your values are the same, then what value should be used to figure out the size of the circle? Or are the values just all the same for each column, but different between the columns? Are all the values in any one column certain to be the same?
Ara
on 19 Dec 2012
Walter Roberson
on 19 Dec 2012
I am confused.
Oh wait, row vs column. S4_0(1,:) is a row, not a column. Okay, so are all the values for one row the same, but the values might differ between rows??
Ara
on 19 Dec 2012
Walter Roberson
on 19 Dec 2012
I'm not sure how s4_0 fits into this? Your s4 here would be a single column, but your s4_0 in your previous code was multiple columns.
Presuming that lati and longi are filtered the same way as data_filter, then it looks like you would want
idx = s4 >= 0.2;
scatter(longi(idx), lati(idx), s4(idx)*2500,'r');
Ara
on 19 Dec 2012
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Performance in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!