How to change the color of a single point in a scatter plot?

24 次查看(过去 30 天)
I am plotting points:
x = [ 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5];
y = [ 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5];
plot(x,y,'*')
I would like to change the color of just an individual point, how do I go about it?

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2013-7-26
x = [ 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5];
y = [ 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5];
plot(x,y)
hold on
scatter(x(7),y(7),'r')
hold off

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by