##// 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 fig.set_edgecolor('white')
100 fig.set_edgecolor('white')
101 try:
101 try:
102 bytes_io = BytesIO()
102 bytes_io = BytesIO()
103 # use 72 dpi to match QTConsole's dpi
103 fig.canvas.print_figure(bytes_io, format=fmt, bbox_inches='tight')
104 fig.canvas.print_figure(bytes_io, format=fmt, dpi=72,
105 bbox_inches='tight')
106 data = bytes_io.getvalue()
104 data = bytes_io.getvalue()
107 finally:
105 finally:
108 fig.set_facecolor(fc)
106 fig.set_facecolor(fc)
@@ -38,18 +38,20 b' class InlineBackend(InlineBackendConfig):'
38
38
39 # The typical default figure size is too large for inline use,
39 # The typical default figure size is too large for inline use,
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. This is configurable via Global.pylab_inline_rc,
41 # make that fit.
42 # or rather it will be once the zmq kernel is hooked up to
43 # the config system.
44 rc = Dict({'figure.figsize': (6.0,4.0),
42 rc = Dict({'figure.figsize': (6.0,4.0),
45 # 12pt labels get cutoff on 6x4 logplots, so use 10pt.
43 # 12pt labels get cutoff on 6x4 logplots, so use 10pt.
46 'font.size': 10,
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 # 10pt still needs a little more room on the xlabel:
48 # 10pt still needs a little more room on the xlabel:
48 'figure.subplot.bottom' : .125
49 'figure.subplot.bottom' : .125
49 }, config=True,
50 }, config=True,
50 help="""Subset of matplotlib rcParams that should be different for the
51 help="""Subset of matplotlib rcParams that should be different for the
51 inline backend."""
52 inline backend."""
52 )
53 )
54
53 figure_format = CaselessStrEnum(['svg', 'png'], default_value='png', config=True,
55 figure_format = CaselessStrEnum(['svg', 'png'], default_value='png', config=True,
54 help="The image format for figures with the inline backend.")
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