How to plot 3D using a table

147 次查看(过去 30 天)
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.

采纳的回答

William Rose
William Rose 2022-6-27
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 个评论
Mad Gano
Mad Gano 2022-7-5
thank you william I appreciate your support
William Rose
William Rose 2022-7-5
@Mad Gano, you are welome. Good luck with your work.

请先登录,再进行评论。

更多回答(1 个)

Pooja Kumari
Pooja Kumari 2022-6-28
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

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by