Skip to content

Instantly share code, notes, and snippets.

@radeksvarz
Created May 13, 2020 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radeksvarz/6788654f69d68642c0b20d72b0e7519c to your computer and use it in GitHub Desktop.
Save radeksvarz/6788654f69d68642c0b20d72b0e7519c to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
from pylab import rand
from random import randint
import numpy as np
# random.randint(a, b) # Return a random integer N such that a <= N <= b.
# numpy.random.randint(low, high=None, size=None, dtype='l') # Return random integers from low (inclusive) to high (exclusive).
#Z = np.random.randint(4, 9+1, 1000)
X = np.random.randint(0, 6+1, size=100)
Y = np.array([ randint(0, 6-xi) for xi in X])
plt.scatter(X,Y, color='r', alpha=0.1)
plt.xlabel("X")
plt.ylabel("Y")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment