plot multiple variables with different colors
Mostra commenti meno recenti
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 Commenti
Adam
il 12 Dic 2016
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
il 12 Dic 2016
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
il 12 Dic 2016
Where in three space should the combination x(1), y(1), z(1) go? What color should the result have?
Jung BC
il 12 Dic 2016
Jung BC
il 12 Dic 2016
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
il 12 Dic 2016
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.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su 2-D and 3-D Plots in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
