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

Skip to content

Commit beba0de

Browse files
authored
Merge pull request #22631 from anntzer/svgtransformspace
2 parents 698397f + f865b46 commit beba0de

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/backends/backend_svg.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import datetime
44
import gzip
55
import hashlib
6-
from io import BytesIO, StringIO
6+
from io import BytesIO
77
import itertools
88
import logging
99
import os
@@ -248,17 +248,17 @@ def flush(self):
248248

249249

250250
def _generate_transform(transform_list):
251-
output = StringIO()
251+
parts = []
252252
for type, value in transform_list:
253253
if (type == 'scale' and (value == (1,) or value == (1, 1))
254254
or type == 'translate' and value == (0, 0)
255255
or type == 'rotate' and value == (0,)):
256256
continue
257257
if type == 'matrix' and isinstance(value, Affine2DBase):
258258
value = value.to_values()
259-
output.write('%s(%s)' % (
259+
parts.append('%s(%s)' % (
260260
type, ' '.join(short_float_fmt(x) for x in value)))
261-
return output.getvalue()
261+
return ' '.join(parts)
262262

263263

264264
@_api.deprecated("3.6")

0 commit comments

Comments
 (0)