I have an array saved as a txt file that has entries corresponding to the value of a distribution in polar coordinates. So it looks like this:
f(r1,theta1) f(r1, theta2) ..... f(r1, theta_max)
f(r2,theta1) f(r2, theta2) ..... .
. .
. .
. .
f(r_max,theta1) .................f(r_max, theta_max)
I want to do a density plot of f (the higher f is, the more red I want the color to be). Is there a way to do this with matplotlib? Explicit code would be helpful, as I am majorly new to this.
In this example,
a
is you theta1...thetan,b
is your r1...rn,c
is your f(a, b):Essentially a filled contour plot in polar axis. You can specify alternative colormap with the
cmap=...
.cm.jet
goes from blue to red, with red being the largest value.