plot multiple variables with different colors
显示 更早的评论
Hi,
I have 3 variables x,y,z; each of them are double numeric arrays and their size is 1x316(all same size.
I want to plot these 3 variables in a 3D graph using scatter3(or any) function where i need to plot each variable in different colors.
Lets say:
scatter3(x,y,z,'ro','bo','go');
but i am unable to plot these with different colors in a same graph.
Please help!
Thanks in advance!
9 个评论
Adam
2016-12-12
I don't understand what you mean by 'each variable in different colours'. Each point in a 3d plot will take one value from each of the 3 variables.
If you want each variable a different colour then you would seem to just one a basic 3 normal scatter plots instead of a single 3d scatter plot.
Adam
2016-12-12
Well, like I said, each point takes a value from each variable so how are you expecting the result to look with each variable its own colour in a 3d plot?
Walter Roberson
2016-12-12
Where in three space should the combination x(1), y(1), z(1) go? What color should the result have?
Jung BC
2016-12-12
Jung BC
2016-12-12
The colours in that example plot are not one per variable, they are just a colour split of the 3d data into 3 different divisions, but every point still has one element from each of the x, y and z variables, just that, for example, points with a radius less than 0.5 are blue, points with between 0.5 and 0.75 are green and points between 0.75 and 1 are yellow (as an example, I don't know what the exact delineation is for that plot).
You need to work out what you want conceptually and then work out how to do it in Matlab.
Walter Roberson
2016-12-12
Please answer my question. Give me a formula for where in 3d x(k),y(k),z(k) should go and what color the resulting point or points should be.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 2-D and 3-D Plots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
