##// END OF EJS Templates
Set default figure size in inline mode to (6,4)....
Set default figure size in inline mode to (6,4). Otherwise, unless users have configured it manually, the default of (8, 6) that mpl uses produces giant figures on the canvas that aren't particularly useful. Since controlling the figure size in inline mode may be a more frequent need, added a top-level helper (most people won't know what the right call is to make otherwise).

File last commit:

r2754:6f2df84b
r3045:18c7e12c
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)