##// END OF EJS Templates
Add support for simultaneous interactive and inline matplotlib plots....
Add support for simultaneous interactive and inline matplotlib plots. In purely svg mode, there is now no lag with draw() operations, they just produce the figure immediately. And in gui mode, a new function, 'paste', is added to plt and to the user's namespace, that pastes open figures from GUI windows into the editing widget as inline SVGs.

File last commit:

r2754:6f2df84b
r2987:94057a1f
Show More
displayhook.py
21 lines | 576 B | text/x-python | PythonLexer
import __builtin__
from session import extract_header
class DisplayHook(object):
def __init__(self, session, pub_socket):
self.session = session
self.pub_socket = pub_socket
self.parent_header = {}
def __call__(self, obj):
if obj is None:
return
__builtin__._ = obj
msg = self.session.msg(u'pyout', {u'data':repr(obj)},
parent=self.parent_header)
self.pub_socket.send_json(msg)
def set_parent(self, parent):
self.parent_header = extract_header(parent)