AttributeError: 'Line2D' object has no property 'ax'

Viewed 2270

Code:

fig, ax = plt.subplots()

Error:

AttributeError: 'Line2D' object has no property 'ax'

1 Answers
plt.figure(figsize=(10, 5))
plt.style.use('seaborn')
fig, ax = plt.subplots()
plt.plot(x,y)
ax.xaxis.set_ticks(x)
Related