# Barlegend with a different z span for ListDensityPlot

I would like to rescale the colors in a plot and to do this in the same way for the color bar. (So this enables me to have the color bar span a (z) range larger than than the data itself.)

I got this running for Plot3D:

Plot3D[Sin[x^2 + y], {x, 0, Pi}, {y, 0, Pi},
ColorFunctionScaling -> False,
ColorFunction -> (ColorData["SolarColors", Rescale[#3, {0, 1}, {0, 1}]] &),
PlotLegends -> BarLegend[{"SolarColors", {0, 1}}, 10]]


How can I accomplish the same for ListDensityPlot? A simple copy and past doesn't do the job; I get an error w.r.t. the used slot number (#3) in the code above. Which slot should be used for this purpose in ListDensityPlot?  DensityPlot[Sin[x^2 + y], {x, 0, Pi}, {y, 0, Pi},
ColorFunction -> (ColorData["TemperatureMap", Rescale[#, {0, 2}, {0, 1}]] &),
PlotLegends -> BarLegend[{"TemperatureMap", {0, 2}}, 10]] I modified the answer by belisarius for listdensityplot and moreover I rescaled the barlegend such that the desired result was obtained:

All the data outside the desired range gets the same "bottom" color.

 data = Table[Sin[u + v^2], {u, 0, 3, .05}, {v, 0, 3, .05}];
zrange = {.5, 1.0}

ListDensityPlot[data,
ColorFunction -> ColorData[{"SolarColors", zrange}],
PlotLegends ->
BarLegend[{(ColorData["SolarColors", Rescale[#, zrange, {0, 1}]] &),
zrange}]] The documentation of Mathematica needs an update for this.