import matplotlib.pyplot as plt
import numpy as np
a=-2
# 0〜2の数字を色に対応させる
pixels = np.array([
    [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1],
    [1,2,3,4,4,4,4,4,4,4,4,4,4,4,3,2,1],
    [1,2,3,4,-1,0,0,0,0,0,0,0,-1,4,3,2,1],
    [1,2,3,4,-1,0,a,1,1,1,a,0,-1,4,3,2,1],
    [1,2,3,4,-1,0,a,1,0,1,a,0,-1,4,3,2,1],
    [1,2,3,4,-1,0,a,a,a,a,a,0,-1,4,3,2,1],
    [1,2,3,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,3,2,1],
    [1,2,3,3,3,3,3,3,3,3,3,3,3,3,3,2,1],
    [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],





])
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: