# How to use DensityPlot in polar cordinate for a range of raduises

I want to show values of a function $$f[r,t]$$ using DensityPlot but I don't know how to show the function only fo $$r>1$$. Could somebody please help me? I have written the below code, but I don't know how to make it work only for $$r>1$$.

Rc = 0.1;
f[r_, t_] :=
Exp[-Sum[(-16 (((r^2 - 2 Rc^2 - r Sqrt[r^2 - 4 Rc^2])/(2 Rc^2)))^(
2 + 4 mz) -
8 (-1)^mz (((r^2 - 2 Rc^2 - r Sqrt[r^2 - 4 Rc^2])/(2 Rc^2)))^(
1 + 2 mz) (Sin[(3 + 2 mz) t] -
Sin[t -
2 mz t]))/((-1 + (((r^2 - 2 Rc^2 -
r Sqrt[r^2 - 4 Rc^2])/(2 Rc^2)))^(2 + 4 mz)) (1 +
2 mz) \[Pi]), {mz, 0, 10}]];
DensityPlot[
f[Sqrt[x^2 + y^2], ArcTan[x, y]], {x, y} \[Element]
Disk[{0, 0}, 1.5],
PlotPoints -> 200, PlotLegends -> Automatic,
ColorFunctionScaling -> False, PlotRange -> {{-1, 2}, {0, 1}, All}]
• When I evaluate your code I get "General::munfl Exp[-938.837] is too small" messages which means that the function needs to be rescaled. I think this also explains why the plot has only two colors. Dec 3, 2019 at 9:01
• How can I rescale it?@Lotus Dec 3, 2019 at 9:03
• Try to plot without Exp, you will see more interesting picture and also PlotLegend shows very big negative values for Sum, that explains message "Exp[...] is too small".
– Alx
Dec 3, 2019 at 9:12
• I agree that it's better but still, most of the plane is blue @Alx Dec 3, 2019 at 9:17
• I think the problem is I can't make exclusion work @Alx because if I can, the very very large values disappear. Dec 3, 2019 at 9:21

It is better to use RegionDifference instead of Exclusions->Disk[...], this also solves the problem of small exponents: they appear near to {0,0} and RegionDifference does exclude this region.

Rc = 0.1;
f[r_, t_] :=
Exp[-Sum[(-16 (((r^2 - 2 Rc^2 -
r Sqrt[r^2 - 4 Rc^2])/(2 Rc^2)))^(2 + 4 mz) -
8 (-1)^mz (((r^2 - 2 Rc^2 -
r Sqrt[r^2 - 4 Rc^2])/(2 Rc^2)))^(1 +
2 mz) (Sin[(3 + 2 mz) t] -
Sin[t - 2 mz t]))/((-1 + (((r^2 - 2 Rc^2 -
r Sqrt[r^2 - 4 Rc^2])/(2 Rc^2)))^(2 + 4 mz)) (1 +
2 mz) π), {mz, 0, 10}]];
DensityPlot[
f[Sqrt[x^2 + y^2], ArcTan[x, y]], {x, y} ∈
Region[RegionDifference[Disk[{0, 0}, 1.5], Disk[{0, 0}, 0.8]]],
PlotLegends -> Automatic, ColorFunction -> "Rainbow",
PlotRange -> {{-2, 2}, {0, 2}, All}, PlotPoints -> 100]

Or using Plot3D:

Plot3D[f[Sqrt[x^2 + y^2], ArcTan[x, y]], {x, y} ∈
Region[RegionDifference[Disk[{0, 0}, 1.5], Disk[{0, 0}, 0.8]]],
PlotLegends -> Automatic, ColorFunction -> "Rainbow",
PlotRange -> {{-2, 2}, {0, 2}, All}, PlotPoints -> 100]