I have a small number of points in 3D space. Each point has an associated weight (real number). For each point, I want to plot a [visible point] whose color is a function of the weight value.
It seems like ListDensityPlot3D
would work for this, but I just get a blank space and I think this is because the points are spaced so far apart and I cannot find an PointSize
option for ListDensityPlot3D
.
My closest work around is to use Graphics3D
and Point
, but I cannot use a BarLegend
because "BarLegend is not a Graphics3D primitive or directive".
I have pasted my workaround and my attempt at using ListDensityPlot3D
.
x = {0, -0.1, 0};
y = {0, 0.8, 0};
z = {0, -0.5, 1};
T = {90.9, 57.7, 0};
Graphics3D[{
Table[
{Hue[T[[i]]], PointSize[0.03],
Point[
{x[[i]], y[[i]], z[[i]]}
]},
{i, 1, 3}],
Opacity[0.05], Cuboid[{-1, -1, -1}, {1, 1, 1}]},
Axes -> True, AspectRatio -> 1
]
ListDensityPlot3D[
Table[{x[[i]], y[[i]], z[[i]], T[[i]]}, {i, 1, 3}]
]