Answered step by step
Verified Expert Solution
Question
1 Approved Answer
trials = np.arange (1,101,1) sums = np.array ([ randint (1,6)+ randint (1,6) for i in trials ]) print('trials', trials) print('sums', sums) fig = plt.figure(tight_layout=True) You
trials = np.arange (1,101,1) sums = np.array ([ randint (1,6)+ randint (1,6) for i in trials ]) print('trials', trials) print('sums', sums) fig = plt.figure(tight_layout=True) You need to complete the program and create a scatter, line, histogram, and pie plots of the obtained data. The scatter and line plots should show the trials as x coordinates and sums as y coordinates. The histogram and the pie plot should show the number of trials that have same sums: for example, sum 2 - 3 trials, sum 3 - 7 trials, etc. Your plots should be arranged as a 22 matrix. You can read about histograms and bar of pie here: Histograms - Matplotlib 3.4.2 documentation B Bar of pie - Matplotlib 3.4.2 documentation Please choose all statements that should be used in your program: ax.scatter(trials, sums, s =3, color='red') ax.plot(sums, trials) ax.hist(sums,color='green') ax= fig.add_subplot (2,2,1) ax.pie(sums, trials) ax.hist(trials,color = 'red') ax = fig.add_subplot (2,1,1)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started