-
-
Save physicsnerd/2cf9d40d3e21983d66fc20d91fa3b144 to your computer and use it in GitHub Desktop.
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
Traceback (most recent call last): | |
File "python", line 1, in <module> | |
ImportError: libtk8.6.so: cannot open shared object file: No such file or directory |
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 math import sqrt | |
import functools | |
n = set(range(1000000)) | |
x = [] | |
y = [] | |
def factors(n): | |
a = [] | |
x = 2 | |
while x * x <= n : | |
if n % x == 0: | |
a.append(x) | |
n /= x | |
else: x += 1 | |
if n > 1: a.append(n) | |
return a | |
for i in n: | |
xr = len(factors(i)) | |
yr = i | |
x.append(xr) | |
y.append(yr) | |
plt.scatter(x, y, | |
color="blue", # Color of the dots | |
s=100, # Size of the dots | |
alpha=0.5, # Alpha/transparency of the dots (1 is opaque, 0 is transparent) | |
linewidths=1) # Size of edge around the dots | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment