Skip to content

Instantly share code, notes, and snippets.

@physicsnerd
Last active November 8, 2016 01:14
Show Gist options
  • Save physicsnerd/2cf9d40d3e21983d66fc20d91fa3b144 to your computer and use it in GitHub Desktop.
Save physicsnerd/2cf9d40d3e21983d66fc20d91fa3b144 to your computer and use it in GitHub Desktop.
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
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