File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5252ax .set_ylim (0. , 1. )
5353
5454# save the figure as a string in the svg format.
55- from io import BytesIO
56- f = BytesIO ()
55+ from io import StringIO
56+ f = StringIO ()
5757plt .savefig (f , format = "svg" )
5858
5959
Original file line number Diff line number Diff line change 4242
4343
4444# save
45- from io import BytesIO
46- f = BytesIO ()
45+ from io import StringIO
46+ f = StringIO ()
4747plt .savefig (f , format = "svg" )
4848
4949import xml .etree .cElementTree as ET
Original file line number Diff line number Diff line change 3535import numpy as np
3636import matplotlib .pyplot as plt
3737import xml .etree .ElementTree as ET
38- from io import BytesIO
38+ from io import StringIO
3939import json
4040
4141plt .rcParams ['svg.embed_char_paths' ] = 'none'
7676 t .set_gid ('leg_text_%d' % i )
7777
7878# Save SVG in a fake file object.
79- f = BytesIO ()
79+ f = StringIO ()
8080plt .savefig (f , format = "svg" )
8181
8282# Create XML tree from the SVG file.
Original file line number Diff line number Diff line change 2424
2525import matplotlib .pyplot as plt
2626import xml .etree .ElementTree as ET
27- from io import BytesIO
27+ from io import StringIO
2828
2929ET .register_namespace ("" , "http://www.w3.org/2000/svg" )
3030
7272ax .set_ylim (- 30 , 30 )
7373ax .set_aspect ('equal' )
7474
75- f = BytesIO ()
75+ f = StringIO ()
7676plt .savefig (f , format = "svg" )
7777
7878# --- Add interactivity ---
You can’t perform that action at this time.
0 commit comments