import numpy as np import matplotlib.pyplot as plt n = 2048 X, Y = np.mgrid[:n,:n] plt.imshow(X^Y, cmap=plt.cm.Spectral) plt.show()