Show More
@@ -216,13 +216,23 b' def import_pylab(user_ns, backend, import_all=True, shell=None):' | |||||
216 | from IPython.zmq.pylab.backend_inline import flush_svg |
|
216 | from IPython.zmq.pylab.backend_inline import flush_svg | |
217 | from matplotlib import pyplot |
|
217 | from matplotlib import pyplot | |
218 | shell.register_post_execute(flush_svg) |
|
218 | shell.register_post_execute(flush_svg) | |
219 |
# The typical default figure size is too large for inline use |
|
219 | # The typical default figure size is too large for inline use, | |
220 | # might make this a user-configurable parameter later. |
|
220 | # so we shrink the figure size to 6x4, and tweak fonts to | |
221 | figsize(6.0, 4.0) |
|
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), | |||
222 | # 12pt labels get cutoff on 6x4 logplots, so use 10pt. |
|
227 | # 12pt labels get cutoff on 6x4 logplots, so use 10pt. | |
223 |
|
|
228 | 'font.size': 10, | |
224 | # 10pt still needs a little more room on the xlabel: |
|
229 | # 10pt still needs a little more room on the xlabel: | |
225 |
|
|
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 | # Add 'figsize' to pyplot and to the user's namespace |
|
236 | # Add 'figsize' to pyplot and to the user's namespace | |
227 | user_ns['figsize'] = pyplot.figsize = figsize |
|
237 | user_ns['figsize'] = pyplot.figsize = figsize | |
228 | shell.user_ns_hidden['figsize'] = figsize |
|
238 | shell.user_ns_hidden['figsize'] = figsize |
General Comments 0
You need to be logged in to leave comments.
Login now