Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How can I display a plot from a script?

If I type

plot(x^2, (x,-2,2))

in sage, I get the expected plot, displayed as a png file by my default image viewer. If instead I put the line

plot(x^2, (x,-2,2)).show()

in a file test.sage and run

sage test.sage

from the command line, I get

Graphics object consisting of 1 graphics primitive

typed on the command line, but no displayed plot.

How do I display a plot from a script?