Created
June 22, 2015 12:53
-
-
Save pravsripad/6c979e09e14732114e80 to your computer and use it in GitHub Desktop.
Circular bar plot - von Mises distribution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Inspired from : | |
# http://matplotlib.org/examples/pie_and_polar_charts/polar_bar_demo.html | |
''' Plot von Mises distribution as a circular bar plot. ''' | |
import numpy as np | |
import matplotlib.pyplot as pl | |
mu = 0. # circular mean phase | |
kappa = np.pi # circular dispersion | |
von = np.random.vonmises(mu, kappa, size=100) | |
# plot circular projection | |
ax = pl.subplot(111, polar=True) | |
radii = np.ones((100)) | |
bars = ax.bar(von, radii, bottom=0., width=(np.pi/180)) | |
pl.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment