python - how to show the plot in pyplot -
i receiving following error code, how can solve it:
from numpy import * import matplotlib mpl mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot plt mpl.rcparams['legend.fontsize'] = 15 fig = plt.figure () ax = fig.gca(projection='3d') t = linspace (-2, 2, 100) x = (1 + t**2) * sin(2 * pi * t) y = (1 + t**2) * cos(2 * pi * t) z = t ax.plot(x, y, z, label='parametric 3d curve') ax.legend() show()
error:
traceback (most recent call last): file "/home/me/workspace/mysecondpythontest/my1pythontest", line 19, in show() nameerror: name 'show' not defined
show()
not exist.
you need call plt.show()
Comments
Post a Comment