Created
February 7, 2021 15:19
-
-
Save anupam-io/088faffb75d068303b2b7062eb410807 to your computer and use it in GitHub Desktop.
GapFinder animation with matplotlib
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 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