Created
March 5, 2015 11:13
-
-
Save wmvanvliet/73b821746e401f9ba935 to your computer and use it in GitHub Desktop.
Centered bubble chart
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
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