1
$\begingroup$

I need to combine two DensityPlot3D in only one graph but the "Show" doesn't work for that.

a = 1;

b = 0.56*a;

fz[x_, y_, z_] = 
  1/Sqrt[Pi * a^2 * b] * Exp[-Sqrt[(x^2 + y^2)/a^2 + z^2/b^2]];

fy[x_, y_, z_] = 
  1/Sqrt[Pi * a^2 * b] * Exp[-Sqrt[(x^2 + z^2)/a^2 + y^2/b^2]];

fx[x_, y_, z_] = 
  1/Sqrt[Pi * a^2 * b] * Exp[-Sqrt[(y^2 + z^2)/a^2 + x^2/b^2]];

A1[x_, y_, z_] = 2*(fx[x, y, z] + fy[x, y, z] + fz[x, y, z])/Sqrt[6];

Hydro[x_, y_, z_] = 1/Sqrt[Pi * a^3] * Exp[-Sqrt[x^2 + y^2 + z^2]/a];


plot1 = DensityPlot3D[A1[x, y, z], {x, -5, 5}, {y, -5, 5}, {z, -5, 5},
    ViewPoint -> Front];

plot2 = DensityPlot3D[
   Hydro[x, y, z], {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, 
   ViewPoint -> Front];

Show[plot1, plot2]

In this code , the show 'function' is just showing the first argument (plot1) and I don't know why.

$\endgroup$

1 Answer 1

4
$\begingroup$

Perhaps the following would show areas at the center more clearly. More experimentation can be done with color schemes.

a = 1;

b = 0.56*a;

fz[x_, y_, z_] = 
  1/Sqrt[Pi*a^2*b]*Exp[-Sqrt[(x^2 + y^2)/a^2 + z^2/b^2]];

fy[x_, y_, z_] = 
  1/Sqrt[Pi*a^2*b]*Exp[-Sqrt[(x^2 + z^2)/a^2 + y^2/b^2]];

fx[x_, y_, z_] = 
  1/Sqrt[Pi*a^2*b]*Exp[-Sqrt[(y^2 + z^2)/a^2 + x^2/b^2]];

A1[x_, y_, z_] = 2*(fx[x, y, z] + fy[x, y, z] + fz[x, y, z])/Sqrt[6];

Hydro[x_, y_, z_] = 1/Sqrt[Pi*a^3]*Exp[-Sqrt[x^2 + y^2 + z^2]/a];

plot1 = SliceDensityPlot3D[
  A1[x, y, z], {"ZStackedPlanes", 5}, {x, -5, 5}, {y, -5, 5}, {z, -5, 
   5}
  , ColorFunction -> "TemperatureMap"
  ];

plot2 = SliceDensityPlot3D[Hydro[x, y, z], 
  "CenterCutSphere", {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, 
  ColorFunction -> "SolarColors"];

Show[plot2, plot1]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.