I tried to convince Mathematica 8 to plot a density map of a function:
$$f(x,y) = \frac{2(x^2 - y^2)-1}{(x^2 + y^2)^2}$$
with color scheme called "TemperatureMap". At $x = \pm 1$, $y = 0$ it's completely correct, but at $y = \pm 1$, $x = 0$, it shows white color, where, in fact, it should be blue. I'm only interested in the region $x^2 + y^2 > 1$, so I added the command: ColorFunctionScaling -> False
and manually rescaled my function to take values only between 0 and 1:
$$g(x,y) = \frac14 (3+f(x,y))$$
as I know where the maxima and minima occur in the region I'm interested in. The plot is even more strange, leaving almost no blue and, of course, at $x = 0, y = \pm 1$ it's white.
Whole input I used was (PlotPoints so I can get higher quality plot, Exclusions so I can see where's the boundary of region I'm interested in):
DensityPlot[(3 + 2*(x^2 - y^2)/(x^2 + y^2)^2 - 1/(x^2 + y^2)^2)/
4, {x, -3, 3}, {y, -3, 3}, PlotPoints -> 100,
ColorFunction -> "TemperatureMap", Exclusions -> {x^2 + y^2 == 1},
ColorFunctionScaling -> True]
I expected a similar density map to the second image on this page. Instead the space approximately $(y/1.2)^2 + x^2 < 1$ is white. The region left of the white part is not exactly an ellipse, it looks like a ladyfinger. Where did I make a mistake?
I tried to plot a constant function 0 and 1 while ColorFunctionScaling
being false and it correctly showed whole plot blue and red respectively. I don't have the slightest clue what went wrong.
I'd appreciate any help.
PlotRange
.PlotRange -> All
clips nothing, but it's not useful here.PlotRange -> m {-1,1}
clips below-m
and abovem
. $\endgroup$