Question: PLEASE USE PYTHON! Write a program to do the following. Create 100 numbers between 0 and 2 using linspace. Create two subplots (two rows and

PLEASE USE PYTHON!

Write a program to do the following.

Create 100 numbers between 0 and 2 using linspace.

Create two subplots (two rows and one column) using these numbers as x. In the top subplot, plot sin(x) with blue dashed lines and a line width of 2. In the bottom subplot, plot sin(x)/2 with red solid lines and sin(2x) with green dotted lines.

For each subplot, set the xlim to be (0, 2) and ylim to be (-1, 1).

Show the legends on each subplot. The top subplot should have a legend "sin(x)" for the blue line, the bottom subplot should have a legend "sin(x)/2" for the red line and "sin(2x)" for the green line.

Save the figure as "hw7.png" with a dpi of 80.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!