# How to fix the PlotRange?

I have the following plot:

dat = {{255, 255, 255}, {0, 0, 153}, {0, 0, 0}, {204, 0, 0}, {255, 255, 255}};
With[{rgb = RGBColor @@@ (dat/255)}, cf = Blend[rgb, #] &;]
DensityPlot[E^(-2 p0^2 - x0^2/2)/π, {x0, -10, 10}, {p0, -7, 7},
ColorFunction -> cf, PlotLegends -> Automatic, WorkingPrecision -> 1000,
PlotPoints -> 100, MaxRecursion -> 5, PlotRange -> {Full, Full, {-1, 1}}]


I try to fix the Plot Range from -1 to 1, but they only allow me to fix it between the maximum and the minimum value of the function, the problem is that i want to compare different plots from different calculations, I am interested just to fix the plotrange to a given one, independently of the function in the plot. I thought it would be simple, but i cannot manage to do it.

• the option of rescale is not posible, for what i comment about the later comparison with other results. – Mento May 11 '15 at 16:42
• Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. – bbgodfrey May 11 '15 at 16:54
• Try and take a look at the discussion in question (82947). – MarcoB May 11 '15 at 17:08
• Specifically, try adding ColorFunctionScaling -> False. – bbgodfrey May 11 '15 at 17:11

PlotLegends -> Placed[BarLegend[{Automatic, {-1, 1}}], Right]