Fix: rename grand_rectangle -> grand_carre

This commit is contained in:
Bertrand Benjamin 2021-06-25 07:57:00 +02:00
parent 4eb6e0aedb
commit bed10d85fe

View File

@ -23,15 +23,7 @@ def trim_axs(axs, N):
return axs[:N]
def grid_to_image(grids, filename):
""" """
plt.clf()
n_cols = 3
n_rows = len(grids) // 3
axs = plt.figure(constrained_layout=True).subplots(n_rows, n_cols)
axs = trim_axs(axs, len(grids))
for ax, grid in zip(axs, grids):
# for i, grid in enumerate(grids):
def draw_image(grid, ax):
hight = len(grid)
lenght = len(grid[0])
ax.tick_params(left=False, bottom=False, labelleft=False, labelbottom=False)
@ -48,6 +40,18 @@ def grid_to_image(grids, filename):
ymax=np.full(lenght, hight) - 0.5,
color="gray",
)
return ax
def grid_to_image(grids, filename):
""" """
plt.clf()
n_cols = 3
n_rows = len(grids) // 3
axs = plt.figure(constrained_layout=True).subplots(n_rows, n_cols)
axs = trim_axs(axs, len(grids))
for ax, grid in zip(axs, grids):
draw_image(grid, ax)
plt.savefig(filename)