##// END OF EJS Templates
use config.Global.inline_rc to initialize matplotlib with the inline backend....
MinRK -
Show More
@@ -216,13 +216,23 b' def import_pylab(user_ns, backend, import_all=True, shell=None):'
216 216 from IPython.zmq.pylab.backend_inline import flush_svg
217 217 from matplotlib import pyplot
218 218 shell.register_post_execute(flush_svg)
219 # The typical default figure size is too large for inline use. We
220 # might make this a user-configurable parameter later.
221 figsize(6.0, 4.0)
222 # 12pt labels get cutoff on 6x4 logplots, so use 10pt.
223 pyplot.rcParams['font.size'] = 10
224 # 10pt still needs a little more room on the xlabel:
225 pyplot.rcParams['figure.subplot.bottom'] = .125
219 # The typical default figure size is too large for inline use,
220 # so we shrink the figure size to 6x4, and tweak fonts to
221 # make that fit. This is configurable via Global.inline_rc,
222 # or rather it will be once the zmq kernel is hooked up to
223 # the config system.
224
225 default_rc = {
226 'figure.figsize': (6.0,4.0),
227 # 12pt labels get cutoff on 6x4 logplots, so use 10pt.
228 'font.size': 10,
229 # 10pt still needs a little more room on the xlabel:
230 'figure.subplot.bottom' : .125
231 }
232 rc = getattr(shell.config.Global, 'inline_rc', default_rc)
233 pyplot.rcParams.update(rc)
234 shell.config.Global.inline_rc = rc
235
226 236 # Add 'figsize' to pyplot and to the user's namespace
227 237 user_ns['figsize'] = pyplot.figsize = figsize
228 238 shell.user_ns_hidden['figsize'] = figsize
General Comments 0
You need to be logged in to leave comments. Login now