Skip to content

Instantly share code, notes, and snippets.

@anupam-io
Created February 7, 2021 15:19
Show Gist options
  • Save anupam-io/088faffb75d068303b2b7062eb410807 to your computer and use it in GitHub Desktop.
Save anupam-io/088faffb75d068303b2b7062eb410807 to your computer and use it in GitHub Desktop.
GapFinder animation with matplotlib
import matplotlib.pyplot as plt
from random import randint, uniform
plt.rcParams['figure.figsize'] = [10, 6]
n = 20
x = [uniform(0, 100) for i in range(n)] # x axis position
y = [uniform(0, 100) for i in range(n)] # y axis position
rad = [uniform(0, 1000) for i in range(n)] # radius of the circle
cat = [randint(1, 5) for i in range(n)] # category
plt.scatter(x, y, s=rad, c=cat, cmap="Accent", alpha=0.6, edgecolors="white", linewidth=2)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment