How to plot heatmap and contour plots in polar coordinates with Plots.jl?



It is really nice to have polar coordinates implemented in Plots.jl:

using Plots; gr()

plot(linspace(0,3π,100), rand(100), proj=:polar, m=:red)


and even nicer to interact with them using the PlotlyJS backend. However, I can’t find documentation on how to plot heatmaps and contour plots in polar coordinates. Could you please give a hand?


This works with pyplot() but almost no other backend:

r = linspace(0,10,11)
θ = linspace(0,360,361)
f(r,θ) = r^2
hm = heatmap(f.(r,θ'), aspect_ratio=:equal, proj=:polar, legend=false)



Thank you @mohamed82008 that is very helpful already. Also, nice trick with dot syntax and transposing theta.


Not mine :slight_smile: got it from Steven There are also nice contour plots near the end of that notebook with PyPlot.jl.


indeed, very nice trick. thanks, m and s.

the url is dead.


It was moved to another directory