import matplotlib.pyplot as plt
import numpy as np

# 0〜2の数字を色に対応させる
pixels = np.array([
    [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,],
    [1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,],
    [2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,],
    [2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,],
    [0,2,2,0,1,0,0,0,0,0,0,0,0,0,0,0,],
    [0,0,2,2,1,1,0,0,0,0,0,0,0,0,0,0,],
    [4,0,3,2,2,1,0,0,0,0,0,0,0,0,0,0,],
    [4,4,3,3,2,2,0,0,0,0,0,0,0,0,0,0,],
    [5,4,4,3,0,2,2,0,1,0,0,0,0,0,0,0,],
    [5,5,4,4,0,0,2,2,1,1,0,0,0,0,0,0,],
    [6,5,0,4,4,0,3,2,2,1,0,0,0,0,0,0,],
    [6,6,0,0,4,4,3,3,2,2,0,0,0,0,0,0,],
])


from matplotlib.colors import ListedColormap
K = ListedColormap(["white", "red", "blue", "green", "yellow","pink", "purple", "orange"])

plt.imshow(pixels, cmap=K, interpolation='nearest')
plt.axis('off')
plt.show()

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: