This module defines the rich output types for 2-d images, both vector and raster graphics.
Bases: sage.repl.rich_output.output_basic.OutputBase
DVI Image
INPUT:
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputImageDvi
sage: OutputImageDvi.example() # indirect doctest
OutputImageDvi container
Construct a sample DVI output container
This static method is meant for doctests, so they can easily construct an example.
OUTPUT:
An instance of OutputImageDvi.
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputImageDvi
sage: OutputImageDvi.example()
OutputImageDvi container
sage: OutputImageDvi.example().dvi
buffer containing 212 bytes
sage: 'TeX output' in OutputImageDvi.example().dvi.get()
True
Bases: sage.repl.rich_output.output_basic.OutputBase
GIF Image (possibly animated)
INPUT:
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputImageGif
sage: OutputImageGif.example() # indirect doctest
OutputImageGif container
Construct a sample GIF output container
This static method is meant for doctests, so they can easily construct an example.
OUTPUT:
An instance of OutputImageGif.
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputImageGif
sage: OutputImageGif.example()
OutputImageGif container
sage: OutputImageGif.example().gif
buffer containing 408 bytes
sage: OutputImageGif.example().gif.get().startswith('GIF89a')
True
Bases: sage.repl.rich_output.output_basic.OutputBase
JPEG Image
INPUT:
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputImageJpg
sage: OutputImageJpg.example() # indirect doctest
OutputImageJpg container
Construct a sample JPEG output container
This static method is meant for doctests, so they can easily construct an example.
OUTPUT:
An instance of OutputImageJpg.
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputImageJpg
sage: OutputImageJpg.example()
OutputImageJpg container
sage: OutputImageJpg.example().jpg
buffer containing 978 bytes
sage: OutputImageJpg.example().jpg.get().startswith('\xff\xd8\xff\xe0\x00\x10JFIF')
True
Bases: sage.repl.rich_output.output_basic.OutputBase
PDF Image
INPUT:
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputImagePdf
sage: OutputImagePdf.example() # indirect doctest
OutputImagePdf container
Construct a sample PDF output container
This static method is meant for doctests, so they can easily construct an example.
OUTPUT:
An instance of OutputImagePdf.
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputImagePdf
sage: OutputImagePdf.example()
OutputImagePdf container
sage: OutputImagePdf.example().pdf
buffer containing 4285 bytes
sage: OutputImagePdf.example().pdf.get().startswith('%PDF-1.4')
True
Bases: sage.repl.rich_output.output_basic.OutputBase
PNG Image
Note
Every backend that is capable of displaying any kind of graphics is supposed to support the PNG format at least.
INPUT:
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputImagePng
sage: OutputImagePng.example() # indirect doctest
OutputImagePng container
Construct a sample PNG output container
This static method is meant for doctests, so they can easily construct an example.
OUTPUT:
An instance of OutputImagePng.
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputImagePng
sage: OutputImagePng.example()
OutputImagePng container
sage: OutputImagePng.example().png
buffer containing 608 bytes
sage: OutputImagePng.example().png.get().startswith('\x89PNG')
True
Bases: sage.repl.rich_output.output_basic.OutputBase
SVG Image
INPUT:
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputImageSvg
sage: OutputImageSvg.example() # indirect doctest
OutputImageSvg container
Construct a sample SVG output container
This static method is meant for doctests, so they can easily construct an example.
OUTPUT:
An instance of OutputImageSvg.
EXAMPLES:
sage: from sage.repl.rich_output.output_catalog import OutputImageSvg
sage: OutputImageSvg.example()
OutputImageSvg container
sage: OutputImageSvg.example().svg
buffer containing 1422 bytes
sage: '</svg>' in OutputImageSvg.example().svg.get()
True