When I use myplotlib in python it returns me, that ‘x’ is not defined [closed]

fig,axes = plt.subplots(nrows=1, ncols=2)

for current_ax in axes:
    current_ax.plot(x,y)

I am copypasting the code from Python in Data Science lecture. Using matplotlib and getting an error: NameError: name 'x' is not defined. I was following the q&a section but no one had this problem before.

  • 5

    You obviously haven’t copied enough of the code from the lecture. There clearly IS NO definition of x in the code, so the error means exactly what it says.

    – 




Leave a Comment