##// END OF EJS Templates
Set default figure size in inline mode to (6,4)....
Fernando Perez -
Show More
@@ -109,8 +109,14 b' def import_pylab(user_ns, backend, import_all=True, shell=None):'
109 # function that will pick up the results for display. This can only be
109 # function that will pick up the results for display. This can only be
110 # done with access to the real shell object.
110 # done with access to the real shell object.
111 if backend == backends['inline']:
111 if backend == backends['inline']:
112 from IPython.zmq.pylab.backend_inline import flush_svg
112 from IPython.zmq.pylab.backend_inline import flush_svg, figsize
113 from matplotlib import pyplot
113 shell.register_post_execute(flush_svg)
114 shell.register_post_execute(flush_svg)
115 # The typical default figure size is too large for inline use. We
116 # might make this a user-configurable parameter later.
117 figsize(6.0, 4.0)
118 # Add 'figsize' to pyplot and to the user's namespace
119 user_ns['figsize'] = pyplot.figsize = figsize
114 else:
120 else:
115 from IPython.zmq.pylab.backend_inline import pastefig
121 from IPython.zmq.pylab.backend_inline import pastefig
116 from matplotlib import pyplot
122 from matplotlib import pyplot
@@ -38,6 +38,16 b' def show(close=True):'
38 show._draw_called = False
38 show._draw_called = False
39
39
40
40
41 def figsize(sizex, sizey):
42 """Set the default figure size to be [sizex, sizey].
43
44 This is just an easy to remember, convenience wrapper that sets::
45
46 matplotlib.rcParams['figure.figsize'] = [sizex, sizey]
47 """
48 matplotlib.rcParams['figure.figsize'] = [sizex, sizey]
49
50
41 def pastefig(*figs):
51 def pastefig(*figs):
42 """Paste one or more figures into the console workspace.
52 """Paste one or more figures into the console workspace.
43
53
@@ -68,9 +78,6 b' def pastefig(*figs):'
68 def send_svg_canvas(canvas):
78 def send_svg_canvas(canvas):
69 """Draw the current canvas and send it as an SVG payload.
79 """Draw the current canvas and send it as an SVG payload.
70 """
80 """
71 # Make the background transparent.
72 # figure_manager.canvas.figure.patch.set_alpha(0.0)
73
74 # Set the background to white instead so it looks good on black. We store
81 # Set the background to white instead so it looks good on black. We store
75 # the current values to restore them at the end.
82 # the current values to restore them at the end.
76 fc = canvas.figure.get_facecolor()
83 fc = canvas.figure.get_facecolor()
General Comments 0
You need to be logged in to leave comments. Login now