In [1]:
import matplotlib
from matplotlib.patches import Rectangle as RE
import matplotlib.pyplot as plt
In [2]:
matplotlib.rc_file_defaults()
fig = plt.figure(figsize = (8, 8))
ax = fig.add_subplot(111, xlim = (-0.3, 3.03), ylim = (-0.3, 3.03))

#Remove axes and ticks.
for side in ['bottom', 'left', 'top', 'right']:
        ax.spines[side].set_visible(False)
ax.set_xticks([])
ax.set_yticks([])

squares = [(0, 1, 'w'),
           (1, 0, 'w'),
           (1, 1, '#CCCCCC'),
           (1, 2, 'w'),
           (2, 1, 'w')]

for s in squares:
    ax.add_patch(RE(xy = (s[0], s[1]),
                    width = 1,
                    height = 1,
                    fc = s[2],
                    ec = 'k'))

plt.savefig("2023.02.17 Express.png",
            bbox_inches = 'tight')

Rohan Lewis¶

2023.02.20¶