Created
May 13, 2020 22:31
-
-
Save radeksvarz/61b99c26ec5d7fce221d3e2f9e3be38a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 pylab import rand, ylim, xlim | |
from random import randint | |
import numpy as np | |
# random.randint(a, b) # Return a random integer N such that a <= N <= b. | |
def onGenerate(): | |
x = randint(0,5) | |
y = randint(1, 6-x) | |
return [[x, y, x + y], [y, x, x + y]][randint(0, 1)] | |
X = [] | |
Y = [] | |
for i in range(100): | |
a, b, c = onGenerate() | |
X.append(a) | |
Y.append(b) | |
plt.scatter(X,Y, color='r', alpha=0.1) | |
plt.xlabel("X") | |
plt.ylabel("Y") | |
# ylim([-1,6]) | |
# xlim([-1,6]) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment