Skip to content

Instantly share code, notes, and snippets.

@pravsripad
Created June 22, 2015 12:53
Show Gist options
  • Save pravsripad/6c979e09e14732114e80 to your computer and use it in GitHub Desktop.
Save pravsripad/6c979e09e14732114e80 to your computer and use it in GitHub Desktop.
Circular bar plot - von Mises distribution
#!/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