Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Thank you, @sebastien. From your comment and documentation references, it seems clear that:

  1. The %matplotlib is an IPython-only mechanism; and
  2. SageMath's command-line IPython backend currently doesn't support matplolib GUI.

The second conclusion comes from the reported by get_display_manager().supported_output():

frozenset({..., <class 'sage.repl.rich_output.output_graphics.OutputImageDvi'>, <class 'sage.repl.rich_output.output_graphics.OutputImageGif'>, <class 'sage.repl.rich_output.output_graphics.OutputImagePdf'>, <class 'sage.repl.rich_output.output_graphics.OutputImagePng'>, ...})

The only other output types for 2D images defined in Sage's library are for JPEG and SVG files. Not a single mention to matplotlib GUI backends. It would be necessary to define a new output type class in order to use it natively in Sage, although it doesn't seem too hard to implement.

For now, I'll live with the Graphics2d to matplotlib object conversion!

Thank you, @sebastien. @23197. From your comment and documentation references, it seems clear that:

  1. The %matplotlib is an IPython-only mechanism; and
  2. SageMath's command-line IPython backend currently doesn't support matplolib GUI.

The second conclusion comes from the reported by get_display_manager().supported_output():

frozenset({..., <class 'sage.repl.rich_output.output_graphics.OutputImageDvi'>, <class 'sage.repl.rich_output.output_graphics.OutputImageGif'>, <class 'sage.repl.rich_output.output_graphics.OutputImagePdf'>, <class 'sage.repl.rich_output.output_graphics.OutputImagePng'>, ...})

The only other output types for 2D images defined in Sage's library are for JPEG and SVG files. Not a single mention to matplotlib GUI backends. It would be necessary to define a new output type class in order to use it natively in Sage, although it doesn't seem too hard to implement.

For now, I'll live with the Graphics2d to matplotlib object conversion!

Thank you, @23197. @sebastien. From your comment and documentation references, it seems clear that:

  1. The %matplotlib is an IPython-only mechanism; and
  2. SageMath's command-line IPython backend currently doesn't support matplolib GUI.

The second conclusion comes from the reported by get_display_manager().supported_output():

frozenset({..., <class 'sage.repl.rich_output.output_graphics.OutputImageDvi'>, <class 'sage.repl.rich_output.output_graphics.OutputImageGif'>, <class 'sage.repl.rich_output.output_graphics.OutputImagePdf'>, <class 'sage.repl.rich_output.output_graphics.OutputImagePng'>, ...})

The only other output types for 2D images defined in Sage's library are for JPEG and SVG files. Not a single mention to matplotlib GUI backends. It would be necessary to define a new output type class in order to use it natively in Sage, although it doesn't seem too hard to implement.

For now, I'll live with the Graphics2d to matplotlib object conversion!

Thank you, @sebastien. @sébastien. From your comment and documentation references, it seems clear that:

  1. The %matplotlib is an IPython-only mechanism; and
  2. SageMath's command-line IPython backend currently doesn't support matplolib GUI.

The second conclusion comes from the reported by get_display_manager().supported_output():

frozenset({..., <class 'sage.repl.rich_output.output_graphics.OutputImageDvi'>, <class 'sage.repl.rich_output.output_graphics.OutputImageGif'>, <class 'sage.repl.rich_output.output_graphics.OutputImagePdf'>, <class 'sage.repl.rich_output.output_graphics.OutputImagePng'>, ...})

The only other output types for 2D images defined in Sage's library are for JPEG and SVG files. Not a single mention to matplotlib GUI backends. It would be necessary to define a new output type class in order to use it natively in Sage, although it doesn't seem too hard to implement.

For now, I'll live with the Graphics2d to matplotlib object conversion!