# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import numpy as np
from random import randint

# +
white = [1 for _ in range(9)]
blue = [2 for _ in range(9)]
green = [3 for _ in range(9)]
yellow = [4 for _ in range(9)]
orange = [5 for _ in range(9)]
red = [6 for _ in range(9)]
face_white = np.array([(white[0], white[1], white[2]), 
                       (white[3], white[4], white[5]), 
                       (white[6], white[7], white[8])])

face_blue = np.array([(blue[0], blue[1], blue[2]), 
                      (blue[3], blue[4], blue[5]),
                      (blue[6], blue[7], blue[8])])

face_green = np.array([(green[0], green[1], green[2]), 
                       (green[3], green[4], green[5]), 
                       (green[6], green[7], green[8])])

face_yellow = np.array([(yellow[0], yellow[1], yellow[2]), 
                        (yellow[3], yellow[4], yellow[5]), 
                        (yellow[6], yellow[7], yellow[8])])

face_orange = np.array([(orange[0], orange[1], orange[2]), 
                        (orange[3], orange[4], orange[5]), 
                        (orange[6], orange[7], orange[8])])

face_red = np.array([(red[0], red[1], red[2]), 
                     (red[3], red[4], red[5]), 
                     (red[6], red[7], red[8])])

# +
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors


cmap, norm = mcolors.from_levels_and_colors([1, 2, 3, 4, 5, 6, 7], ['lavender', 'blue', 'limegreen', 'yellow', 'orange', 'red'])

plt.imshow(face_white, cmap=cmap, norm=norm)
plt.grid()
plt.colorbar()

plt.show()

StarcoderdataJupyterScriptsDedupFiltered