Plot data points
l = [0,1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
t = [0.69, 0.90, 1.19, 1.30, 1.47, 1.58, 1.77, 1.83, 1.94]
tsquare = square(t)
tsquare
plot(l, tsquare, ".")
I am getting an error -
In [16]: plot(l, tsquare, ".")
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-16-91fb2daa7489> in <module>
----> 1 plot(l, tsquare, ".")
ValueError: x and y must have same first dimension, but have shapes (10,) and (9,)
Can you please check the error ?
Python-3.4.3 Plotting-Data 03-04 min 10-20 sec
Answers:
try to use single quotes ' ' in the plot command or rewatch the video again.
I already tried using single quotes and I even tried giving it a different color.
24-05-21, 12:28 p.m.
lizadeka44@gmail.com
Can you explain the ValueError and check it once again?
I also had this error. Let me check again.
24-05-21, 7:54 p.m.
tusharsm2661
1st check the first element of the I list it's "0,1", not "0.1". So write 0.1 . Second, before executing the entire command, please use "%pylab" to access pylab package. Thank you
24-05-21, 8:05 p.m.
tusharsm2661
Thank you, it worked.
25-05-21, 10:14 a.m.
lizadeka44@gmail.com