In [1]:
%pylab inline
In [2]:
x = np.linspace(0, 4*pi, 1001)
In [3]:
y = sin(x)
In [4]:
plot(x, y);
plot(x[::250], y[::250], 'x')
plot(x[125::250], y[125::250], 'o')
Out[4]:
In [5]:
with plt.xkcd():
plot(x, y);
plot(x[::250], y[::250], 'x')
plot(x[125::250], y[125::250], 'o')
In [26]:
from mpl_toolkits.mplot3d import Axes3D
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(X, Y)
Z = sin(sqrt(X**2 + Y**2))
ax = gca(projection='3d')
surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.autumn, linewidth=0.2)
plt.show()
In [ ]: