Skip to content

Commit

Permalink
Fix pyzx.draw() causing an error due to missing subplotspec in some…
Browse files Browse the repository at this point in the history
… matplotlib environments.

Fixes #222.
  • Loading branch information
dlyongemallo committed May 5, 2024
1 parent 107c24e commit d80022c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyzx/drawing.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ def draw_matplotlib(

if isinstance(g, Circuit):
g = g.to_graph(zh=True)
fig1 = plt.figure(figsize=figsize)
ax = fig1.add_axes([0, 0, 1, 1], frameon=False)
fig1, ax = plt.subplots(figsize=figsize)
ax.set_frame_on(False)
ax.set(xlim=(0, 1), ylim=(0, 1))
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
vs_on_row: Dict[FloatInt, int] = {} # count the vertices on each row
Expand Down

0 comments on commit d80022c

Please sign in to comment.