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
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