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

Answered By
1 Like
Related Questions
The score of a team in 5 IPL matches is available to you. Write a program to create a pie chart from this data, showing the last match's performance as a wedge.
The prices of a stock for 3 months are given. Write a program to show the variations in prices for each month by 3 lines on same line chart. Make sure to add legends and labels. Show grid also.
Navya has started an online business. A list stores the number of orders in last 6 months. Write a program to plot this data on a horizontal bar chart.
Given the following set of data :
Weight measurements for 16 small orders of French-fries (in grams). 78 72 69 81 63 67 65 75 79 74 71 83 71 79 80 69Create a simple histogram from the above data.