# Density plot in polar coordinate [duplicate]

I am trying to do a density plot of a function in polar coordinates. The function I am interested in study is
$$\Lambda^4 (1 - Cos(\frac{r[t]}{f_r} - \frac{\theta[t]}{f_{\theta}})) + \frac{1}{2} m^2 r[t]^2$$

but I don't know how to plot that onto a plane ($$r[t]Cos(\theta[t])$$, $$r[t]Sin(\theta[t])$$).

the parameters can be $$f_r = 10^{-3}, f_{\theta} = 10^{-1}, m = 10^{-4}, \Lambda = 10^{-3}$$

Any suggestions?

## marked as duplicate by J. M. will be back soon♦ plotting StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Oct 8 '18 at 14:20

• Where did that function you are trying to plot come from? – J. M. will be back soon Oct 8 '18 at 13:51
• An inflationary model – rob Oct 8 '18 at 13:54
• You see, $\Lambda$, $m$, and $f$ are not defined in your post, and you did not clarify what those subscripts for $f$ are intended for. – J. M. will be back soon Oct 8 '18 at 14:00
• They are just defined parameters – rob Oct 8 '18 at 14:01
• @UlrichNeumann Even better would be to color the plot by height and pick a ViewPoint infinitely above: ParametricPlot3D[{r Cos[t], r Sin[t], f[r, t]}, {r, 0, R}, {t, 0, 2 Pi}, ColorFunction -> "Rainbow", ViewPoint -> {0, 0, Infinity}] – Michael E2 Oct 8 '18 at 14:10

One way:

f[r_, t_] := Cos[3 t] Sin[4 r]/(1 + r^2);
DensityPlot[
f[Sqrt[x^2 + y^2], ArcTan[x, y]], {x, y} ∈ Disk[{0, 0}, 2],
Exclusions -> None, PlotPoints -> 50] Alternative way, based on a deleted comment by @UlrichNeumann:

ParametricPlot3D[{r Cos[t], r Sin[t], f[r, t]},
{r, 0, 2}, {t, 0, 2 Pi},
ColorFunction -> "Rainbow", ViewPoint -> {0, 0, Infinity},
Lighting -> {{"Ambient", White}}, BoundaryStyle -> Black,
Axes -> {True, True, False}] 