Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e951bd6

Browse files
committed
Fix ImportError: No module named 'StringIO' on Python 3
1 parent 02c1c3a commit e951bd6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

examples/user_interfaces/svg_tooltip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import matplotlib.pyplot as plt
2626
import xml.etree.ElementTree as ET
27-
from StringIO import StringIO
27+
from io import BytesIO
2828

2929
ET.register_namespace("", "http://www.w3.org/2000/svg")
3030

@@ -72,7 +72,7 @@
7272
ax.set_ylim(-30, 30)
7373
ax.set_aspect('equal')
7474

75-
f = StringIO()
75+
f = BytesIO()
7676
plt.savefig(f, format="svg")
7777

7878
# --- Add interactivity ---

0 commit comments

Comments
 (0)