##// END OF EJS Templates
Merge branch 'newkernel' of git://github.com/ellisonbg/ipython into qtfrontend
Merge branch 'newkernel' of git://github.com/ellisonbg/ipython into qtfrontend

File last commit:

r2814:6e6dcc90
r2815:8dc9cdff merge
Show More
backend_payload.py
23 lines | 669 B | text/x-python | PythonLexer
/ IPython / zmq / pylab / backend_payload.py
epatters
Initial checkin of (not yet working) matplotlib payload backend and associated machinery.
r2756 """ Provides basic funtionality for payload backends.
"""
# Local imports.
Brian Granger
First working draft of new payload system.
r2814 from IPython.core.interactiveshell import InteractiveShell
epatters
Initial checkin of (not yet working) matplotlib payload backend and associated machinery.
r2756
def add_plot_payload(format, data, metadata={}):
""" Add a plot payload to the current execution reply.
Parameters:
-----------
format : str
Identifies the format of the plot data.
data : str
The raw plot data.
metadata : dict, optional [default empty]
Allows for specification of additional information about the plot data.
"""
Brian Granger
First working draft of new payload system.
r2814 payload = dict(type='plot', format=format, data=data, metadata=metadata)
InteractiveShell.instance().payload_manager.write_payload(payload)