Q. Write a program to plot a scatter graph taking a random distribution in X, Y, Z and W (all three with shape as (100,) having random integers) and plotted against each other.


Answer :-

import numpy as np
import matplotlib.pyplot as plt

X = np.random.randint(1, 100, size = (100,))
Y = np.random.randint(1, 100, size = (100,))
Z = np.random.randint(1, 100, size = (100,))

plt.scatter (X, Y, color = 'r')
plt.scatter (X,Z, color = 'b')
plt.xlabel("X values")
plt.ylabel("Y & Z values")

plt.show()


Output :-

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post