#!/usr/bin/python3

print('*** Zgled polar density plot - 28.09.2020 ***')
#https://stackoverflow.com/questions/9071084/polar-contour-plot-in-matplotlib-best-modern-way-to-do-it

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm

#-- Generate Data -----------------------------------------
# Using linspace so that the endpoint of 360 is included...
azimuths=np.radians(np.linspace(0,360,20))
zeniths=np.arange(0,70,10)

r,theta=np.meshgrid(zeniths, azimuths)
values=np.random.random((azimuths.size,zeniths.size))

#-- Plot... ------------------------------------------------
fig,ax=plt.subplots(subplot_kw=dict(projection='polar'))
ax.contourf(theta,r,values,cmap=cm.cool) #https://matplotlib.org/3.1.0/tutorials/colors/colormaps.html#colorcet

plt.show()

print('*** Konec ***')
