# plotting – How to combine a density plot with a normal plot

In my code I have a density plot and several plots of ellipses. My objective is to try and get it to be one plot all together. My attempt to this was simply using the Show function however it only outputs the density plot and not the ellipses.

My code is given below

``````DensityPlot((E^-(x^2 + y^2)^2)^2 + ((E^-(x^2 + y^2)^2) (x^2 +
y^2) Cos(2 Pi))^2, {x, -3, 3}, {y, -3, 3},
PlotTheme -> "Minimal", PlotRange -> All, PlotPoints -> 50,
ColorFunction -> "Rainbow");

means(n_) := MovingAverage(Subdivide(##, n) & @@ #, 2) &

centers({nc_, nr_}, {xrange_, yrange_}) :=
Tuples({means(nc)@xrange, means(nr)@yrange});

{xrange, yrange} = {{-3, 3}, {-3, 3}};

{nc, nr} = {5, 5};

centers({nc, nr}, {xrange, yrange});

ClearAll(centers2)
centers2(region_ : Disk({0, 0}, 1))({nc_, nr_}, {xrange_, yrange_}) :=
Select(RegionMember(region))@centers({nc, nr}, {xrange, yrange});
{xrange, yrange} = {{-3, 3}, {-3, 3}};

{nc, nr} = {6, 6};

Show(dp, Graphics({White, PointSize(Medium), Circle(),
Point@centers2()({nc, nr}, {xrange, yrange})}))

ClearAll(ellipsoid)
GeometricTransformation(
RotationTransform(angle, center))

cp = centers2(Disk({0, 0}, radius))({nc, nr}, {xrange, yrange});
plots = Table(point = Part(cp, i); x = Part(point, 1);
y = Part(point, 2); ex = (E^-(x^2 + y^2)^2)^2;
ey = ((E^-(x^2 + y^2)^2) (x^2 + y^2) Cos(2 Pi))^2;
s1 = ex^2 - ey^2;
s2 = 2 ex ey Cos(0);
inside = 2 s2/s1;
angle = ArcTan(inside);
sd = Graphics({EdgeForm({Thick}), Opacity(.75), Transparent,
ellipsoid({0, 0}, {0.2, 0.1}, angle), Opacity(1), Red,
Point({0, 0}),}),
{i, Length(cp)})

Show(plots, dp)

``````