Changing colors in scatter plots?
Show older comments
Greetings all,
I was trying to somehow change colors of a scatter plot I have of two values.
What I started off with was this:
scatter(ModelFile(:,4), z_i_1_abs)
where the "x" value - ModelFile(:,4) has 1156x1 values, and the same for the "y" value - z_i_1_abs - it also has 1156x1 values. This line plots succesfully, but I want ModelFile(:,4) to be one color and z_i_1_abs to be a separate color. When I plot it now, both are blue.
So I looked at gscatter and the good old plot command, and I tried hold on, but I just keep getting errors.
Any advice?
Thanks!
-J
5 Comments
Image Analyst
on 25 Feb 2012
I don't understand. It's a scatter plot - it's not like you have two different sets of data where you can plot each with a certain color against some independent x axis. Your array ModelFile DEFINES the x axis. You have the kth point at (x,y) where x=ModelFile(k,4) and y = z_i_1_abs(k). What's to distinguish one set from the other?
Jesse
on 28 Feb 2012
Jiro Doke
on 28 Feb 2012
Right. You can't have 2 colors for a single point. You can't even do that with a paper and a colored pencil. Unless you're saying you want half of the circle to be one color and the other half of the circle to be another. But I doubt that's what you want.
Walter Roberson
on 28 Feb 2012
By the way: Image Analyst's name is not "Walter".
Jesse
on 28 Feb 2012
Accepted Answer
More Answers (0)
Categories
Find more on Scatter Plots 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!