Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 380ef8fffb3cac803d291d64359bd34a1efc5935 1 parent 94057a1
Fernando Perez authored September 08, 2010
2  IPython/core/interactiveshell.py
@@ -2122,7 +2122,7 @@ def run_cell(self, cell):
2122 2122
         # This seems like a reasonable usability design.
2123 2123
         last = blocks[-1]
2124 2124
         if len(last.splitlines()) < 2:
2125  
-            self.runcode('\n'.join(blocks[:-1]))
  2125
+            self.runcode(''.join(blocks[:-1]))
2126 2126
             self.runlines(last)
2127 2127
         else:
2128 2128
             self.runcode(cell)
4  IPython/lib/pylabtools.py
@@ -113,7 +113,9 @@ def import_pylab(user_ns, backend, import_all=True, shell=None):
113 113
             shell.register_post_execute(flush_svg)
114 114
         else:
115 115
             from IPython.zmq.pylab.backend_payload_svg import paste
116  
-            user_ns['paste'] = paste
  116
+            from matplotlib import pyplot
  117
+            # Add 'paste' to pyplot and to the user's namespace
  118
+            user_ns['paste'] = pyplot.paste = paste
117 119
 
118 120
     if import_all:
119 121
         exec("from matplotlib.pylab import *\n"

0 notes on commit 380ef8f

Please sign in to comment.
Something went wrong with that request. Please try again.