Question: Question 1 ( 3 points ) : Purpose: To practice plotting with a simple loop In their simplest form, computers are often used to plot
Question points:
Purpose: To practice plotting with a simple loop
In their simplest form, computers are often used to plot or graph mathematical equations. For this question, you'll write a program to plot very simple polynomials of the form
Plotting with Matplotlib
To do the actual plotting, we will use the matplotlib library. This library is NOT standard, so you may need to install it separately. If you installed Python with Anaconda, hopefully this is as simple as bring up a terminal and typing conda install matplotlib.
A code example has been provided showing how to make a very simple plot using matplotlib. Take a look at it and play around until you understand what the different function calls do
Plotting Polynomials
Write a program that first asks the user for the following information:
The values to use for and for the polynomial
How many points to plot which we'll call
Then, write a loop to add all points to the plot. The coordinate for the points should go from O to going up by each time. The coordinate for each point is given by the formula for our polynomial,
Once all the points have been added, show the plot using matplotlib's show method.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
