Question

1 - Write a python program that plots the following 4 functions

in one graph using the subplot command and matplotlib

package. Include legend, title, grid, x label, and y label. The

range of x is -10 to +10 with 1000 samples.

a. red color

b. blue color

c.

magenta color

d. yellow color

Hint: Final answer should look like below:

Magnitude

Magnitude

100

75

50

25

0

-10

10

0.5

0.0

-05

-10-

-10

f(x)=x²

f(x)

0

5

-5

Numbe of Samples

k(x)=sin(x)

0 5

Numbe of Samples

10

10

Magnitude

1000

500

ap

0

-500

-1000 t

2000

1500

1000

500

-10

g(x)=x³

glx)

-5

0

Numbe of Samples

Xx)-2-**1

0

-10 -5

0

5

Numbe of Samples

10

Kx)

10

Save the python program for this question under

"LastName_FirstName_FinalExamQ1.py"

Question image 1