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!
