KnowledgeBoat Logo
|

Informatics Practices

A distribution data stores about 1000 random number. Write a program to create a scatter chart from this data with varying point sizes.

PyPlot

1 Like

Answer

import numpy as np
import matplotlib.pyplot as plt
X = np.random.randint(1, 100, size = (1000,))
Y = np.random.randint(1, 100, size = (1000,))
sizes = np.random.randint(10, 100, size=100)
plt.scatter(X, Y, s = sizes, color = 'r')
plt.show()
Output
A distribution data stores about 1000 random number. Write a program to create a scatter chart from this data with varying point sizes. Plotting with Pyplot, Informatics Practices Computer Science Sumita Arora Solutions CBSE Class 12

Answered By

1 Like


Related Questions