MATLAB Matlab Scatter Plot: Adding Colored Point

  • Thread starter Thread starter Poisonous
  • Start date Start date
  • Tags Tags
    Matlab Plot
AI Thread Summary
To add a differently colored point to an existing scatter plot in MATLAB, the scatter function requires a size parameter in addition to the coordinates and color. The correct syntax for the scatter function is scatter(x, y, size, color). If a standard size is desired, an empty array can be used as the size parameter. The initial attempt to use hold on and hold off was correct, but the omission of the size parameter caused the issue. For further reference, the MATLAB documentation on the scatter function provides detailed guidance.
Poisonous
Messages
26
Reaction score
0
I have a scatter plot of data already created. I want to add a different colored point to the plot at specific coordinates. How can I do this? I tried using hold on, plotting my data, then writing scatter(1,0,r) hold off to plot a red point at (1,0) but its not working.
 
Physics news on Phys.org

Similar threads

Replies
5
Views
2K
Replies
1
Views
2K
Replies
9
Views
5K
Replies
1
Views
5K
Replies
4
Views
3K
Replies
1
Views
2K
Replies
5
Views
3K
Back
Top