Generate a 2D grid of shape (n_samples, 2)
np.vstack(map(np.ravel, np.meshgrid(x, y))).T
Cycle over line styles (source)
import matplotlib.pyplot as plt
from itertools import cycle
lines = ["-", "--", "-.", ":"]
linecycler = cycle(lines)
plt.figure()
for i in range(10):
x = range(i,i+10)
plt.plot(range(10),x,next(linecycler))
plt.show()
Matplotlib 3d plots (source)
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
Numpy performance tips: