File size: 577 Bytes
0a3edb6
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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")