Skip to content

Instantly share code, notes, and snippets.

@sjvrijn
Created November 4, 2019 13:23
Show Gist options
  • Save sjvrijn/9c26ce14d2600a6a18ce84c9971d2280 to your computer and use it in GitHub Desktop.
Save sjvrijn/9c26ce14d2600a6a18ce84c9971d2280 to your computer and use it in GitHub Desktop.
recreation of a drawing I saw somewhere
# coding: utf-8
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import Normalize
def recreate(n=8000, s=5, scale=1.45, ymax=.68):
norm = Normalize(vmin=0, vmax=1, clip=True)
origin = np.array([.5, 0])
X = np.random.random((n, 2))
dst = np.linalg.norm(X-origin, axis=1) * scale
plt.scatter(X[:,0], X[:,1], c=dst, cmap='gist_rainbow_r', norm=norm, s=s, alpha=.8)
plt.xlim([0,1])
plt.ylim([0,ymax])
plt.show()
recreate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment