Matlab Scatter Plot: Adding Colored Point

  • MATLAB
  • Thread starter Poisonous
  • Start date
  • Tags
    Matlab Plot
In summary, A scatter plot in Matlab is a type of graph that shows the relationship between two variables by displaying data points as individual dots. To create a scatter plot in Matlab, you can use the <code>scatter()</code> function, and to add color, you can use the <code>'MarkerFaceColor'</code> parameter. You can also customize the size and shape of the points using <code>'MarkerSize'</code> and <code>'MarkerShape'</code> parameters. Additionally, you can add a legend to a scatter plot using the <code>legend()</code> function.
  • #1
Poisonous
26
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
  • #2
Last edited by a moderator:

1. What is a scatter plot in Matlab?

A scatter plot in Matlab is a type of graph that shows the relationship between two variables by displaying data points as individual dots. It is used to visualize patterns and trends in the data.

2. How do I create a scatter plot in Matlab?

To create a scatter plot in Matlab, you can use the scatter() function. This function takes in two vectors of data points as its input and plots them as individual dots on a graph.

3. How can I add color to the points in a scatter plot in Matlab?

To add color to the points in a scatter plot in Matlab, you can use the 'MarkerFaceColor' parameter in the scatter() function. This parameter allows you to specify the color of the markers in the plot.

4. Can I customize the size and shape of the points in a scatter plot in Matlab?

Yes, you can customize the size and shape of the points in a scatter plot in Matlab using the 'MarkerSize' and 'MarkerShape' parameters in the scatter() function. These parameters allow you to specify the size and shape of the markers in the plot.

5. Is it possible to add a legend to a scatter plot in Matlab?

Yes, you can add a legend to a scatter plot in Matlab by using the legend() function. You can specify the labels for each data series in the plot and their corresponding colors to create a legend that explains the meaning of the data points in the plot.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
834
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
Back
Top