take reference from this-import matplotlib.pyplot as plt x=[1,2,3,4,5,6,7,8,9]…
Rate quality
Private research annotation
Sign in to add a private research label or note.
- User
take reference from this-import matplotlib.pyplot as plt x=[1,2,3,4,5,6,7,8,9] y=[1,4,6,8,10,12,14,16,18] plt.plot(x,y,'og--',label='myplot') plt.xlabel('time in seconds') plt.ylabel('distance') plt.legend() plt.show() and answer-Question 1: (a) Define a list named x that is assigned with the elements 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (b) Define another list named y whose elements are the e xi . Here, xi are the individual elements of x. (c) Define another list named z whose elements are the e0.2xi . Here, xi are the individual elements of x (d) Define another list named a whose elements are the e0.3xi . Here, xi are the individual elements of x (e) Define another list named b whose elements are the e0.4xi . Here, xi are the individual elements of x (c) Make a graph to plot y vs x , z vs x , a vs x , and b vs x in the same plot.
- Assistant
To address your request, I will take each part step by step, applying Python and the Matplotlib library as illustrated in your reference code.
a) Define a list named
xpythonx = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]b) Define another list named whose elements are the (e^{x_i})
- User
write the whole python code correctly
- Assistant
Certainly, here's the combined and complete Python code based on the instructions given:
python