Show More
@@ -97,15 +97,10 b" def print_figure(fig, fmt='png'):" | |||||
97 |
|
97 | |||
98 | fc = fig.get_facecolor() |
|
98 | fc = fig.get_facecolor() | |
99 | ec = fig.get_edgecolor() |
|
99 | ec = fig.get_edgecolor() | |
100 | fig.set_facecolor('white') |
|
100 | bytes_io = BytesIO() | |
101 | fig.set_edgecolor('white') |
|
101 | fig.canvas.print_figure(bytes_io, format=fmt, bbox_inches='tight', | |
102 | try: |
|
102 | facecolor=fc, edgecolor=ec) | |
103 |
|
|
103 | data = bytes_io.getvalue() | |
104 | fig.canvas.print_figure(bytes_io, format=fmt, bbox_inches='tight') |
|
|||
105 | data = bytes_io.getvalue() |
|
|||
106 | finally: |
|
|||
107 | fig.set_facecolor(fc) |
|
|||
108 | fig.set_edgecolor(ec) |
|
|||
109 | return data |
|
104 | return data | |
110 |
|
105 | |||
111 |
|
106 |
@@ -40,6 +40,9 b' class InlineBackend(InlineBackendConfig):' | |||||
40 | # so we shrink the figure size to 6x4, and tweak fonts to |
|
40 | # so we shrink the figure size to 6x4, and tweak fonts to | |
41 | # make that fit. |
|
41 | # make that fit. | |
42 | rc = Dict({'figure.figsize': (6.0,4.0), |
|
42 | rc = Dict({'figure.figsize': (6.0,4.0), | |
|
43 | # play nicely with white background in the Qt and notebook frontend | |||
|
44 | 'figure.facecolor': 'white', | |||
|
45 | 'figure.edgecolor': 'white', | |||
43 | # 12pt labels get cutoff on 6x4 logplots, so use 10pt. |
|
46 | # 12pt labels get cutoff on 6x4 logplots, so use 10pt. | |
44 | 'font.size': 10, |
|
47 | 'font.size': 10, | |
45 | # 72 dpi matches SVG/qtconsole |
|
48 | # 72 dpi matches SVG/qtconsole |
General Comments 0
You need to be logged in to leave comments.
Login now