Permalink
Browse files

Add paste to plt, fix spurious newlines in cell mode.

  • Loading branch information...
1 parent 94057a1 commit 380ef8fffb3cac803d291d64359bd34a1efc5935 @fperez fperez committed Sep 8, 2010
Showing with 4 additions and 2 deletions.
  1. +1 −1 IPython/core/interactiveshell.py
  2. +3 −1 IPython/lib/pylabtools.py
@@ -2122,7 +2122,7 @@ def run_cell(self, cell):
# This seems like a reasonable usability design.
last = blocks[-1]
if len(last.splitlines()) < 2:
- self.runcode('\n'.join(blocks[:-1]))
+ self.runcode(''.join(blocks[:-1]))
self.runlines(last)
else:
self.runcode(cell)
@@ -113,7 +113,9 @@ def import_pylab(user_ns, backend, import_all=True, shell=None):
shell.register_post_execute(flush_svg)
else:
from IPython.zmq.pylab.backend_payload_svg import paste
- user_ns['paste'] = paste
+ from matplotlib import pyplot
+ # Add 'paste' to pyplot and to the user's namespace
+ user_ns['paste'] = pyplot.paste = paste
if import_all:
exec("from matplotlib.pylab import *\n"

0 comments on commit 380ef8f

Please sign in to comment.