##// END OF EJS Templates
allow change of PNG DPI in inline backend...
MinRK -
Show More
@@ -100,9 +100,7 b" def print_figure(fig, fmt='png'):"
100 100 fig.set_edgecolor('white')
101 101 try:
102 102 bytes_io = BytesIO()
103 # use 72 dpi to match QTConsole's dpi
104 fig.canvas.print_figure(bytes_io, format=fmt, dpi=72,
105 bbox_inches='tight')
103 fig.canvas.print_figure(bytes_io, format=fmt, bbox_inches='tight')
106 104 data = bytes_io.getvalue()
107 105 finally:
108 106 fig.set_facecolor(fc)
@@ -38,18 +38,20 b' class InlineBackend(InlineBackendConfig):'
38 38
39 39 # The typical default figure size is too large for inline use,
40 40 # so we shrink the figure size to 6x4, and tweak fonts to
41 # make that fit. This is configurable via Global.pylab_inline_rc,
42 # or rather it will be once the zmq kernel is hooked up to
43 # the config system.
41 # make that fit.
44 42 rc = Dict({'figure.figsize': (6.0,4.0),
45 43 # 12pt labels get cutoff on 6x4 logplots, so use 10pt.
46 44 'font.size': 10,
45 # 72 dpi matches SVG/qtconsole
46 # this only affects PNG export, as SVG has no dpi setting
47 'savefig.dpi': 72,
47 48 # 10pt still needs a little more room on the xlabel:
48 49 'figure.subplot.bottom' : .125
49 50 }, config=True,
50 51 help="""Subset of matplotlib rcParams that should be different for the
51 52 inline backend."""
52 53 )
54
53 55 figure_format = CaselessStrEnum(['svg', 'png'], default_value='png', config=True,
54 56 help="The image format for figures with the inline backend.")
55 57
General Comments 0
You need to be logged in to leave comments. Login now