Skip to content

Instantly share code, notes, and snippets.

@wmvanvliet
Created March 5, 2015 11:13
Show Gist options
  • Save wmvanvliet/73b821746e401f9ba935 to your computer and use it in GitHub Desktop.
Save wmvanvliet/73b821746e401f9ba935 to your computer and use it in GitHub Desktop.
Centered bubble chart
import matplotlib.pyplot as plt
from matplotlib.patches import Circle
import numpy as np
plt.figure()
s = [ 50000.,10478.2, 4733.4,3185.3,2484.7,2310.9]
for s_ in s:
radius = np.sqrt(s_)/np.pi
plt.gca().add_patch(Circle((1, radius), radius))
plt.ylim(0, 150)
plt.axes().set_aspect('equal', 'datalim')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment