plot() function error
Title
Question
Throwing error for x value not found
Python-3.4.3 Using-plot-command-interactively 08-09 min 10-20 sec
Answers:
Please mention the tutorial title, number and the video timstamp.
Please Answer this , x is not defined
In [19]: plot (sin(x)*sin(x))/x
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-19-a04439361098> in <module>
----> 1 plot (sin(x)*sin(x))/x
TypeError: unsupported operand type(s) for /: 'Line2D' and 'float'
In [20]: plot (sin(x)*sin(x))
Out[20]: [<matplotlib.lines.Line2D at 0x468e790>]
In [21]:
you have to define x by using linspace also y axis if this one is x axis vice-versa.
Login to add comment