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

Skip to content

Commit 927acf8

Browse files
committed
Fix bbox_inches="tight" in Python 3.x
1 parent a4f5fa5 commit 927acf8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/matplotlib/backend_bases.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"""
2929

3030
from __future__ import division, print_function
31-
import os, warnings, time
31+
import os, warnings, time, io
3232

3333
import numpy as np
3434
import matplotlib.cbook as cbook
@@ -1939,9 +1939,9 @@ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',
19391939
# the backend to support file-like object, i'm going
19401940
# to leave it as it is. However, a better solution
19411941
# than stringIO seems to be needed. -JJL
1942-
#result = getattr(self, method_name)(
1942+
#result = getattr(self, method_name)
19431943
result = print_method(
1944-
cStringIO.StringIO(),
1944+
io.BytesIO(),
19451945
dpi=dpi,
19461946
facecolor=facecolor,
19471947
edgecolor=edgecolor,

0 commit comments

Comments
 (0)