Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 13 years ago

fakaff gravatar image

Script stops working when imported to sage terminal ("plot" not defined)

So everything works fine in the sage notebook, and even if I pretty much rewrite the same commands in the Sage terminal. So it can't be a problem with the script.

But when I copy, paste and save the whole script as a standalone file.sage, and then try

run file.sage

... suddenly:

---> 30 multiPlot = plot(graphs, (x, 0, times[len(times)-1]+3), ymin=0)
    31 
    32 

NameError: name 'plot' is not defined

Why doesn't it read "plot" correctly and expect me to define it?

click to hide/show revision 2
No.2 Revision

Script stops working when imported to sage terminal ("plot" not defined)

EDIT: OK, so basically, the Sage command line is not recognizing any sage commands (sqrt, etc) when they are contained in an imported .sage file. It's as if when I import a file to Sage, it doesn't read it using the Sage library. Is there something I have to add to the header of a .sage file for it to be read properly?


Old message:

So everything works fine in the sage notebook, and even if I pretty much rewrite the same commands in the Sage terminal. So it can't be a problem with the script.

But when I copy, paste and save the whole script as a standalone file.sage, and then try

run file.sage

... suddenly:

---> 30 multiPlot = plot(graphs, (x, 0, times[len(times)-1]+3), ymin=0)
    31 
    32 

NameError: name 'plot' is not defined

Why doesn't it read "plot" correctly and expect me to define it?