Skip to content

Commit

Permalink
Merge pull request #223 from dlyongemallo/fix_matplotlib_error
Browse files Browse the repository at this point in the history
Fix `pyzx.draw()` causing an error due to missing subplotspec in some matplotlib environments.
  • Loading branch information
jvdwetering authored Jun 29, 2024
2 parents 6d4dc46 + d80022c commit 7c1ee73
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 7c1ee73

Please sign in to comment.