# Region plot in the $xy$-plane of $f(x,y,z) < 0$

I want to plot the region in the $$xy$$-plane which satisfies $$f(x,y,z) < 0$$, where $$z$$ can take values in the range [-1, 1]. How do I do this in Mathematica?

• Have you looked at RegionPlot3D? Feb 19, 2019 at 13:03
• This example might be relevant. Feb 19, 2019 at 19:18
• Thanks, @m_goldberg. As Roman gave an explicit example of how to it. This will solve my problem for now! But I am wondering if I can do it in general for functions of more than 3 variables and I still want a 2D Regionplot. Feb 20, 2019 at 10:46

In general, for each $$z$$ value, the projection of the contours of $$f(x,y,z)$$ onto the $$xy$$-plane will be different, so there is no single "region in the $$xy$$-plane which satisfies $$f(x,y,z) < 0$$". All you can do, I think, is look at contour plots for a sequence values of $$z$$. Here are two examples of how you might make such a sequence. Since you didn't supply an example of f, I will use this one:

f[x_, y_, z_] := x^2 + y^3 - z^2


### SliceContourPlot3D

SliceContourPlot3D[
f[x, y, z], {"ZStackedPlanes", 5},
{x, -3, 3}, {y, -3, 3}, {z, -1, 1},
RegionFunction -> (f[#1, #2, #3] < 0 &),
AxesLabel -> {"X", "Y", "Z",}]


### Projection onto 2D contour plots

GraphicsColumn[
Table[
ContourPlot[f[x, y, z], {x, -3, 3}, {y, -3, 3},
PlotLabel -> Row[{"z = ", z, "\n"}],
Contours -> Range[-5, 0],
ImageSize -> Medium],
{z, Subdivide[-1, 1, 4] // N}]]


As @mgoldberg says, do a RegionPlot3D and view it flat from above (projecting out the $$z$$-axis):

f[x_, y_, z_] = x^2 + y^3 - z^2;
RegionPlot3D[f[x, y, z] < 0, {x, -3, 3}, {y, -3, 3}, {z, 0, 1}, ViewPoint -> {0, 0, ∞}]


In this way you can see which $$(x,y)$$ values allow $$f(x,y,z)<0$$ for any $$z\in[-1,1]$$.

Using @ChipHurst's suggestion seems a bit more tricky and gives a poor quality plot:

Region[ImplicitRegion[Exists[z, 0<z<1 && f[x,y,z]<0], {x, y}],
PlotRange -> {{-3,3},{-3,3}}]