How to plot 3D using a table
50 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Mad Gano
le 27 Juin 2022
Commenté : William Rose
le 5 Juil 2022
I have for example this table
I would like to plot this table 3D so that the values in between have to be interpreted with respect to the balloon size but also with smooth color change (here I use e.g. colormap(jet)).
P.s
Actually I can't understand the surf(X,Y,Z,C) because X,Y,Z are only vectors and C can't be defined.
0 commentaires
Réponse acceptée
William Rose
le 27 Juin 2022
Please sypply your data as a mat file or text file instead of an image. Thank you.
I do not understand your goal. Do you want to plot spheres of different radii and colors, with centers at the specified x,y,z values? If so, it appears that there will b a number of pairs of balloons that mostly overlap eachother.
Do the specified x,y,z points represent samples of a surface, and you want to interpolate to get other points on the surface? If so, then you might be able to interpolate z values at other x,y locations, or you can interpolate radii or colors at other x,y locations, or you can do all three, but those interpolations must be done independently. Is that your goal? If it is your goal, then it will be difficult, because the distribution of points in the table is very uneven in the x-y plane. X values range from 1.41 to 3.66, but are unevenly spread. Y values are also unevenly spread: y=4.69 (n=2), y=6.56 (n=7), y=8.36 (n=1), y=8.44 (n=25).
9 commentaires
Plus de réponses (1)
Pooja Kumari
le 28 Juin 2022
Dear Mad Gano,
It is my understanding that you want to plot the given table in 3D using surf function and the values X,Y,Z have to be interpreted with respect to balloon size.
surf(X,Y,Z,C) creates a 3-D surface plot with x-y plane defined by X and Y and C taken surface color only.
You can only plot 3D graph using surf with three parameters at a time. So, if you want to plot your data with respect to balloon size.
%with different combination of X,Y,Z with respect to %BalloonSize.
surf(X,Y,BalloonSize)
surf(Y,Z,BalloonSize)
surf(Z,X, BalloonSize)
For more information on surf function, you can follow the provided documentation below:
For more information on jet function, follow the below provided link:
Sincerely,
Pooja Kumari
0 commentaires
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!