3D Plot With Different Colors for each Class

3 views (last 30 days)
Hi,
I have a a set of points I would like to plot in a 3D space.
They are represented as: [x1 x2 x3 ... xn ; y1 y2 y3 ... yn] hence making it a 2xn matrix
I then have a n*1 vector containing class labels.
Right now, I am plotting them in a 2D space using:
gscatter(new_data(1,:),new_data(2,:),trainlabels,[],'<x+*sdv^o>ph.')
However, I would now like to add a third dimension making my data matrix a 3xn matrix. Is there any way I can obtain a result similar to gscatter but in three dimensions?
Thanks! :)

Answers (1)

Star Strider
Star Strider on 6 Mar 2015
The scatter3 function is as close as you can likely get. See Scatter Series Properties for details.

Tags

Community Treasure Hunt

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

Start Hunting!