Start by Importing the libraries Matplotlib and numpy.
For this example numpy will be used to generate a random sample set of 50 objects.
Next, set the colors and dot sizes. Then create the scatter plot.
Finally, call the plt.show() function to view the scatter plot.
import matplotlib.pyplot as plt
import numpy as np
#Generating random Sample
Sample_Data = 50
x = np.random.rand(Sample_Data)
y = np.random.rand(Sample_Data)
#Setting color and dot size
colors = (0,0,0)
area = np.pi*9
#Creating the plot
plt.scatter(x, y, s=area, c=colors, alpha=1)
plt.title('Scatter plot Example ')
plt.xlabel('x')
plt.ylabel('y')
#Calling Plot function
plt.show()
Output
