Note
This documentation is for a development version of IPython. There may be significant differences from the latest stable release (1.2.1).
Top-level display functions for displaying object in different formats.
Authors:
Bases: object
An object that wraps data to be displayed.
Create a display object given raw data.
When this object is returned by an expression or passed to the display function, it will result in the data being displayed in the frontend. The MIME type of the data should match the subclasses used, so the Png subclass should be used for ‘image/png’ data. If the data is a URL, the data will first be downloaded and then displayed. If
Parameters: | data : unicode, str or bytes
url : unicode
filename : unicode
|
---|
Reload the raw data from file or URL.
Bases: IPython.core.display.DisplayObject
Validate that display data is text
Bases: IPython.core.display.TextDisplayObject
Create a Javascript display object given raw data.
When this object is returned by an expression or passed to the display function, it will result in the data being displayed in the frontend. If the data is a URL, the data will first be downloaded and then displayed.
In the Notebook, the containing element will be available as element, and jQuery will be available. The output area starts hidden, so if the js appends content to element that should be visible, then it must call container.show() to unhide the area.
Parameters: | data : unicode, str or bytes
url : unicode
filename : unicode
lib : list or str
css: : list or str
|
---|
Bases: IPython.core.display.DisplayObject
Create a PNG/JPEG image object given raw data.
When this object is returned by an input cell or passed to the display function, it will result in the image being displayed in the frontend.
Parameters: | data : unicode, str or bytes
url : unicode
filename : unicode
format : unicode
embed : bool
width : int
height : int
retina : bool
|
---|
Examples
# embedded image data, works in qtconsole and notebook # when passed positionally, the first arg can be any of raw image data, # a URL, or a filename from which to load image data. # The result is always embedding image data for inline images. Image(‘http://www.google.fr/images/srpr/logo3w.png‘) Image(‘/path/to/image.jpg’) Image(b’RAW_PNG_DATA...’)
# Specifying Image(url=...) does not embed the image data, # it only generates <img> tag with a link to the source. # This will not work in the qtconsole or offline. Image(url=’http://www.google.fr/images/srpr/logo3w.png‘)
Reload the raw data from file or URL.
Display a Python object in all frontends.
By default all representations will be computed and sent to the frontends. Frontends can decide which representation is used and how.
Parameters: | objs : tuple of objects
raw : bool, optional
include : list or tuple, optional
exclude : list or tuple, optional
metadata : dict, optional
|
---|
Display the pretty (default) representation of an object.
Parameters: | objs : tuple of objects
raw : bool
metadata : dict (optional)
|
---|
Display the HTML representation of an object.
Parameters: | objs : tuple of objects
raw : bool
metadata : dict (optional)
|
---|
Display the SVG representation of an object.
Parameters: | objs : tuple of objects
raw : bool
metadata : dict (optional)
|
---|
Display the PNG representation of an object.
Parameters: | objs : tuple of objects
raw : bool
metadata : dict (optional)
|
---|
Display the JPEG representation of an object.
Parameters: | objs : tuple of objects
raw : bool
metadata : dict (optional)
|
---|
Display the LaTeX representation of an object.
Parameters: | objs : tuple of objects
raw : bool
metadata : dict (optional)
|
---|
Display the JSON representation of an object.
Note that not many frontends support displaying JSON.
Parameters: | objs : tuple of objects
raw : bool
metadata : dict (optional)
|
---|
Display the Javascript representation of an object.
Parameters: | objs : tuple of objects
raw : bool
metadata : dict (optional)
|
---|
Display the PDF representation of an object.
Parameters: | objs : tuple of objects
raw : bool
metadata : dict (optional)
|
---|
Clear the output of the current cell receiving output.
Parameters: | wait : bool [default: false]
|
---|
Select figure formats for the inline backend. Optionally pass quality for JPEG.
For example, this enables PNG and JPEG output with a JPEG quality of 90%:
In [1]: set_matplotlib_formats('png', 'jpeg', quality=90)
To set this in your config files use the following:
c.InlineBackend.figure_formats = {'png', 'jpeg'}
c.InlineBackend.print_figure_kwargs.update({'quality' : 90})
Parameters: | *formats : strs
**kwargs :
|
---|
Set whether the inline backend closes all figures automatically or not.
By default, the inline backend used in the IPython Notebook will close all matplotlib figures automatically after each cell is run. This means that plots in different cells won’t interfere. Sometimes, you may want to make a plot in one cell and then refine it in later cells. This can be accomplished by:
In [1]: set_matplotlib_close(False)
To set this in your config files use the following:
c.InlineBackend.close_figures = False
Parameters: | close : bool
|
---|