Why is this matplotlib code giving me a weird exception? I'm going for two rows of plots. The top row is supposed to show true vs. pred and the bottom row is supposed to show percent error.
yy = func(*X)
fig, axes = plt.subplots(1, len(X))
for ax,_x in zip(axes,X):
ax.plot(_x, y, 'b.')
ax.plot(_x, yy, 'r.')
fig, axes = plt.subplots(2, len(X))
for ax,_x in zip(axes,X):
ax.plot(_x, yy/y-1, 'r.')
plt.show()
Traceback:
File "pysr.py", line 235, in main
ax.plot(_x, yy/y-1, 'r.')
AttributeError: 'numpy.ndarray' object has no attribute 'plot'
X
,y
, andfunc
are? I'm not able to reproduce the error you showed. Just a thought, if the code you are running has a typo and is insteadfor ax, _x in zip(X, axes)
, that would reproduce the error (and be a typo I could totally see myself making.) – Blue_vision Jun 29 '16 at 23:47