A Jupyter Notebook contains two code cells. The first one reads 1 import numpy as np 2 import matplotlib.pyplot as plt and produces no output. The second code cell produces the following output: y position 3 2 1 7 -2 -3 X = -3 -2 -1 In-term 1 1 X 2 T 3 5 Select all of the following lines of code that can be found in the second code cell. (Note that they may not appear in the order in which they were executed.) [-1.5, 1.0, -0.5, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5] plt.plot(x, [1/_x if _x != 0 else np. nan for _x in x], color='blue', linestyle='solid', marker='0') Oplt.xlabel('x') Oplt.ylabel('y position') O plt.plot(x, [_x**2 for _x in x], color='blue', marker='x') plt. ylim(-4, 3) O plt.title('In-term 1') O plt.xlim (-3, 5) plt.show() X = np. linspace(-1, 5, 150)

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question
A Jupyter Notebook contains two code cells. The first one reads
1 import numpy as np
2 import matplotlib.pyplot as plt
and produces no output. The second code cell produces the following output:
y position
3
2
1
7
-2
-3
X =
-3
-2
-1
In-term 1
1
X
2
T
3
5
Select all of the following lines of code that can be found in the second code cell. (Note that they may not appear in the order in which they were executed.)
[-1.5, 1.0, -0.5, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5]
plt.plot(x, [1/_x if _x != 0 else np. nan for _x in x], color='blue', linestyle='solid', marker='0')
Oplt.xlabel('x')
Oplt.ylabel('y position')
O plt.plot(x, [_x**2 for _x in x], color='blue', marker='x')
plt. ylim(-4, 3)
O plt.title('In-term 1')
O plt.xlim (-3, 5)
plt.show()
X = np. linspace(-1, 5, 150)
Transcribed Image Text:A Jupyter Notebook contains two code cells. The first one reads 1 import numpy as np 2 import matplotlib.pyplot as plt and produces no output. The second code cell produces the following output: y position 3 2 1 7 -2 -3 X = -3 -2 -1 In-term 1 1 X 2 T 3 5 Select all of the following lines of code that can be found in the second code cell. (Note that they may not appear in the order in which they were executed.) [-1.5, 1.0, -0.5, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5] plt.plot(x, [1/_x if _x != 0 else np. nan for _x in x], color='blue', linestyle='solid', marker='0') Oplt.xlabel('x') Oplt.ylabel('y position') O plt.plot(x, [_x**2 for _x in x], color='blue', marker='x') plt. ylim(-4, 3) O plt.title('In-term 1') O plt.xlim (-3, 5) plt.show() X = np. linspace(-1, 5, 150)
Expert Solution
steps

Step by step

Solved in 1 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning