How to plot 3D heat map in Matlab

Hi. I have (x,y,z) coordinates with measured values called (w) corresponding to these (x,y,z) coordinates. I want to produce a heat map for the measured value (w) in 3D. Is there anyway to do that.

7 comentarios

Adam Danz
Adam Danz el 13 de Jun. de 2021
Use surf(X,Y,Z,C) where x and y are vectors or matrices and z and c are matrices (C is your variable, w).
Kaushal Kishore
Kaushal Kishore el 13 de Jun. de 2021
Hi Thank you. In my case all x,y,z,w are vectors. how do i convert z and w to matrices.
Cris LaPierre
Cris LaPierre el 13 de Jun. de 2021
Do your x and y vectors contain repeating values? I.e. do they represent a grid of coordinate pairs, or a single line of points?
Kaushal Kishore
Kaushal Kishore el 13 de Jun. de 2021
They represent grid of coordinate (x,y,z)
Kaushal Kishore
Kaushal Kishore el 13 de Jun. de 2021
I am also attaching my sample data
You could try a bubble chart if surf doesn't work out for you.
data = [
0 0 0.2 3
0.5 0 0.3 6
1 0 0.4 8
1.5 0 0.5 3
2 0 0.6 2
0 0.5 0.2 5
0.5 0.5 0.3 4
1 0.5 0.4 3
1.5 0.5 0.5 8
2 0.5 0.6 2
0 1 0.2 3
0.5 1 0.3 5
1 1 0.4 6
1.5 1 0.5 1
2 1 0.6 2
0 1.5 0.2 3
0.5 1.5 0.3 6
1 1.5 0.4 4
1.5 1.5 0.5 6
2 1.5 0.6 8
0 2 0.2 6
0.5 2 0.3 2
1 2 0.4 4
1.5 2 0.5 6
2 2 0.6 4];
bubblechart3(data(:,1),data(:,2),data(:,3),ones(size(data,1),1),data(:,4),'MarkerEdgeColor','none')
Kaushal Kishore
Kaushal Kishore el 14 de Jun. de 2021
Thank you. It works

Iniciar sesión para comentar.

 Respuesta aceptada

Image Analyst
Image Analyst el 14 de Jun. de 2021

0 votos

There is not much heat to plot in that small data set. You might just visualize it with plot3() and make the markers somewhat large.
If you want to interpolate between the few discrete points, you can use scatteredInterpolant.
F = scatteredInterpolant(x,y,z,v) creates a 3-D interpolant of the form v = F(x,y,z).
I'm attaching a 2-D demo (not 3-D)

Más respuestas (0)

Categorías

Más información sobre Data Distribution Plots en Centro de ayuda y File Exchange.

Preguntada:

el 13 de Jun. de 2021

Comentada:

el 14 de Jun. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by