It looks like DensityPlot
and ListDensityPlot
automatically clip the plot range to the min and max value of the data, when PlotRange
is set to be larger.
For example:
When the plot range is smaller than the range of the data PlotRange works
DensityPlot[Sin[x] Sin[y], {x, -4, 4}, {y, -3, 3},
PlotRange -> {Automatic, Automatic, {-0.5, 0.5}},
PlotLegends -> Automatic]
but when the plot range is larger than the range of the data, it has no effects
DensityPlot[Sin[x] Sin[y], {x, -4, 4}, {y, -3, 3},
PlotRange -> {Automatic, Automatic, {-2, 2}},
PlotLegends -> Automatic]
PlotRange
in 3D and 1D behaves more like what we expected:
Plot3D[Sqrt[1 - x^2 - y^2], {x, -2, 2}, {y, -2, 2},
PlotRange -> {Automatic, Automatic, {0, 2}}]
Plot[Sin[x], {x, 0, 6 Pi}, PlotRange -> {Automatic, {-2, 2}}]
So why does PlotRange
in DensityPlot
and ListDensityPlot
behave like this? It looks inconsistent to me.