Skip to content

Instantly share code, notes, and snippets.

@lizecillie
Created August 12, 2013 15:48
Show Gist options
  • Save lizecillie/6212105 to your computer and use it in GitHub Desktop.
Save lizecillie/6212105 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
import numpy as np
A = np.zeros((256, 256, 3))
for i in xrange(0, 255, 3):
A[i, :, 0] = 255*np.ones((1, A.shape[1]))
A[i+1, :, 1] = 255*np.ones((1, A.shape[1]))
A[i+2, :, 2] = 255*np.ones((1, A.shape[1]))
A = np.dstack((A[:, :, 0], A[:, :, 1], A[:, :, 2]))
plt.imshow(A)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment