In Matplotlib, I am trying to plot the following grid:

The following formula gives me the length of each row:
xlen_max = 4
ylen = 7
for g in range(ylen):
xlen = min(ylen-g, xlen_max)
print(xlen)
4
4
4
4
3
2
1
I try to apply it to matplotlib as such:
fig, axes = plt.subplots(ylen, xlen_max , figsize=(5, 5))
for aa, axlist[aa] in enumerate(axes):
for a, ax in enumerate(axlist[aa]):
xlen = min(ylen-g, xlen_max)
if xlen > a :
axlist[aa][a].axis('off')
Or variations on that, but this returns various error and/or weird shaped plot grid.. Anyone as a quick idea/suggestion/hint what could be the way forward?
