Skip to content

Instantly share code, notes, and snippets.

@hclivess
Last active July 7, 2022 16:21
Show Gist options
  • Save hclivess/1f036f8b1ef61a97d0fbc42d66c82c00 to your computer and use it in GitHub Desktop.
Save hclivess/1f036f8b1ef61a97d0fbc42d66c82c00 to your computer and use it in GitHub Desktop.
from numpy.random import seed
from numpy.random import normal
import matplotlib.pyplot as plt
def get_ndist_list(loc=0, scale=1, size=100):
return list(normal(loc=loc, scale=scale, size=size))
def define_x_axis(y_axis):
x_axis = []
x_axis_moved = []
for entry in enumerate(y_axis):
x_axis.append(entry[0])
for entry in x_axis:
x_axis_moved.append(entry-0.5*len(x_axis))
return x_axis_moved
def get_y_axis(ndist):
left_y = ndist.copy()
left_y.sort()
right_y = left_y.copy()
right_y.reverse()
y_axis = left_y + right_y
return y_axis
y_axis = get_y_axis(ndist=get_ndist_list())
x_axis = define_x_axis(y_axis)
plt.plot(x_axis, y_axis)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment