beyarkay's picture
Lane re-export scripts and progress, window debugging scripts
0a3edb6 verified
Raw History Blame Contribute Delete
577 Bytes
import pickle, random, sys
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
sys.path.insert(0, "scripts")
from render_png import draw
import corpus.convert as cv
v = pickle.load(open(sys.argv[1], "rb"))
fig, axes = plt.subplots(1, len(v), figsize=(22 * len(v), 22))
for ax, (i, (r, x0, y0)) in zip(axes, v.items()):
w = cv.paste(r, x0, y0, 32, cv.edit(r, x0, y0, 32, random.Random(0)))
draw(w, ax, f"#{i}")
ax.set_xticks(range(32)); ax.set_yticks(range(32)); ax.tick_params(labelsize=14)
fig.savefig(sys.argv[2], dpi=50, bbox_inches="tight")