# Plotting Two ListDensityPlot3D Plots Together

I would like to plot two ListDensityPlot3D plots in the same plot. My two data sets are intersecting, and I would like to see that the two shapes intersect. However, when I plot them only one is visible. Here is the code to reproduce my results, the data being plotted is coordPhi and coordPhi2:

X = Table[(2*15./(2*60 + 1))*i, {i, -60, 60}];
Y = Table[(2*15./(2*60 + 1))*i, {i, -60, 60}];
Z = Table[-14. + 2*14/60*i, {i, 0, 60}];
coordPhi =
Flatten[Table[{X[[i]], Y[[j]], Z[[k]],
E^(-(X[[i]]^2 + Y[[j]]^2 + Z[[k]]^2))}, {i, 1, 121}, {j, 1,
121}, {k, 1, 61}], 2];
coordPhi2 =
Flatten[Table[{X[[i]] + 2, Y[[j]] + 2, Z[[k]] + 2,
E^(-(X[[i]]^2 + Y[[j]]^2 + Z[[k]]^2))}, {i, 1, 121}, {j, 1,
121}, {k, 1, 61}], 2];
p1 = ListDensityPlot3D[coordPhi];
p2 = ListDensityPlot3D[coordPhi2];
Show[p1, p2, PlotRange -> {{-10, 10}, {0, 10}, {-10, 10}},
PlotLegends -> Automatic]

Try using an "OpacityFunction" like:

p1 = ListDensityPlot3D[coordPhi, OpacityFunction -> (0.2 &),
ColorFunction -> Function[{z}, Hue[z]]];
p2 = ListDensityPlot3D[coordPhi2, OpacityFunction -> (0.2 &)];
Show[p2, p1, PlotRange -> {{-10, 10}, {0, 10}, {-10, 10}},
PlotLegends -> Automatic]

• When i do this, all I see plotted is p2 Oct 4, 2022 at 13:19
• I think we have a version problem. The plot above was done using 13.1. Oct 4, 2022 at 13:41
• Your plot also only shows p2 I believe. If it showed p1 as well, then there would be two different blobs. Oct 4, 2022 at 14:41
• I think you are mistaken. p2 looks like a ball, my plot looks like a rugby ball. Oct 4, 2022 at 15:01
• It looks like a rugby ball due to being stretched in the z direction, if you plot in the range PlotRange -> {{-10, 10}, {-10, 10}, {-10, 10}}, you will see one normal ball I believe. Oct 4, 2022 at 15:38