Borrar filtros
Borrar filtros

Making a 3D Density plot given Density at each point (X,Y,Z)

73 visualizaciones (últimos 30 días)
Saad khalid
Saad khalid el 4 de Oct. de 2022
Respondida: Vinayak el 20 de Oct. de 2022
I have a 3D matrix where each element corresponds to the density at point (X,Y,Z), see attached. The coordinates and data are loaded by the below code. The first two axis of xyPhi correspond to xh and yh, and the third axis corresponds to z. I would like to do a 3D density plot using this data, it should look something like a puck. I essentially want the equivalent of ListDensityPlot3D in Mathematica. Here is what the plot looks like in mathematica
M=60;%number of radial spatial lattice points
N = 60; %number of z-axis lattice points
R = 15;
Z = 14;
dr=double(2*R/(2*M+1));
dz = 2*Z/N;
xh = dr*(-M:1:M);
yh = dr*(-M:1:M);
z = -Z*ones(N+1,1) + dz*(0:1:N).';
load('phi_cylind_film_xy','xyPhi')

Respuestas (1)

Vinayak
Vinayak el 20 de Oct. de 2022
MATLAB provides a variety of plots for visualization such as line plots, scatter charts, animated plots etc.
More on the different types of plots provided can be found here
To plot data with density, you can have your data converted to matrices and use the mesh and surface plots.
More on this can be found here, https://www.mathworks.com/help/matlab/surface-and-mesh-plots-1.html

Categorías

Más información sobre Scatter Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by