How avoid this Warning when I use Contour

For the x-y plane region meeting last condition:

using Plots;gr()

f(x,y) = x + y - 2
g(x,y) = x - y - 1

θ(x,y) = (f(x,y) < 10) & (g(x,y) < 20 ) ? 1 : NaN

x = y = LinRange(-30,30,1000)
heatmap(x,y,θ, c=:lightblue, legend=false, ratio=1, xlims=extrema(x),ylims=extrema(y))

This other way displays the boundary too:

using Colors, Plots;gr()

f(x,y) = x + y - 2
g(x,y) = x - y - 1

θ(x,y) = (f(x,y) < 10) & (g(x,y) < 20 ) ? 1 : -1

x = y = LinRange(-30,30,1000)
Plots.contourf(x,y,θ, c = palette([:white,:lightblue]), legend=false,ratio=1, xlims=extrema(x),ylims=extrema(y))
Plots.contour!(x,y,θ, c=:red, lw=2,levels=[0])

4 Likes