Ask Your Question

About sage.plot.plot.EMBEDDED_MODE

asked 2018-06-28 21:26:31 +0200

mmmm1998 gravatar image

Cantor program used sage-cli, and in this program there is need to disable external viewers. I found sage variable, which, I hope, will do it: sage.plot.plot.EMBEDDED_MODE.

But after setting sage.plot.plot.EMBEDDED_MODE to True I haven't any changes: external viewer starts, for example, for plots.

But in src/sage/structure/ on line 161 we have launch_viewer function, which, I think, start external viewer and where there is this condition:

from sage.plot.plot import EMBEDDED_MODE
    raise RuntimeError('should never launch viewer in embedded mode')

So, as I see, if sage.plot.plot.EMBEDDED_MODE is True, we don't start external viewer, because we exit from function launc_viewer with RuntimeError. But sage works fine with EMBEDDED_MODE = True. Could anyone explain this behavior, is it a bug with sage.plot.plot.EMBEDDED_MODE or I am wrong?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-07-06 14:02:44 +0200

vdelecroix gravatar image

updated 2018-07-06 14:06:23 +0200

You should be using

sage: from sage.repl.rich_output import get_display_manager
sage: dm = get_display_manager()

The other possibilities for graphics are 'raster' (for png) and 'vector' (for pdf).

The EMBEDDED_MODE is probably a left over of older Sage versions.

EDIT: you probably want to create a modeled on the various in $SAGE_ROOT/src/sage/repl/rich_output/ (see e.g. on github).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2018-06-28 21:26:31 +0200

Seen: 426 times

Last updated: Jul 06 '18