Show More
@@ -95,10 +95,10 b' def figsize(sizex, sizey):' | |||||
95 | matplotlib.rcParams['figure.figsize'] = [sizex, sizey] |
|
95 | matplotlib.rcParams['figure.figsize'] = [sizex, sizey] | |
96 |
|
96 | |||
97 |
|
97 | |||
98 | def print_figure(fig, fmt='png', **kwargs): |
|
98 | def print_figure(fig, fmt='png', bbox_inches='tight', **kwargs): | |
99 | """Print a figure to an image, and return the resulting bytes |
|
99 | """Print a figure to an image, and return the resulting bytes | |
100 |
|
100 | |||
101 |
Any |
|
101 | Any keyword args are passed to fig.canvas.print_figure, | |
102 | such as ``quality`` or ``bbox_inches``. |
|
102 | such as ``quality`` or ``bbox_inches``. | |
103 | """ |
|
103 | """ | |
104 | from matplotlib import rcParams |
|
104 | from matplotlib import rcParams | |
@@ -118,6 +118,7 b" def print_figure(fig, fmt='png', **kwargs):" | |||||
118 | fc=fig.get_facecolor(), |
|
118 | fc=fig.get_facecolor(), | |
119 | ec=fig.get_edgecolor(), |
|
119 | ec=fig.get_edgecolor(), | |
120 | dpi=dpi, |
|
120 | dpi=dpi, | |
|
121 | bbox_inches=bbox_inches, | |||
121 | ) |
|
122 | ) | |
122 | # **kwargs get higher priority |
|
123 | # **kwargs get higher priority | |
123 | kw.update(kwargs) |
|
124 | kw.update(kwargs) |
General Comments 0
You need to be logged in to leave comments.
Login now