John H Palmieri wrote:
> This question comes from
> http://stackoverflow.com/questions/41638257/graphics-in-sage-script:
> if I have a file "foo.sage" and I want to run "sage foo.sage" and have
> it pop up a window displaying a plot, how do I do this?

Running sage < foo.sage instead of sage foo.sage works for me.

Another option (not really satisfying either!) is as follows:

~/tmp$ cat foo.sage                                                             
from sage.repl.interpreter import get_test_shell                                
from sage.repl.rich_output import get_display_manager                           
from sage.repl.rich_output.backend_ipython import \  
     BackendIPythonCommandline
get_display_manager().switch_backend(                                           
        BackendIPythonCommandline(),                                            
        shell=get_test_shell())                                                 
                                                                                
plot(sin(x)).show()                                                             
~/tmp$ sage foo.sage                                                            
Launched png viewer for Graphics object consisting of 1 graphics 
primitive

-- 
Marc

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to