Ask Your Question

How do I display the full output that includes graphics?

asked 2011-03-30 13:59:24 -0500

Sammy Black gravatar image


I am working in the notebook GUI.

I have code that produces graphics (.png files) to display arrays with colors satisfying certain combinatorial criteria. When the output gets too long, Sage returns the message

WARNING: Output truncated!

The .txt file contains some html code, but doesn't display in a web browser.


How do I see my graphical arrays?

edit retag flag offensive close merge delete


It would be very helpful to have a minimal case that produces this. You can get it by having a loop like "for i in range(100000): print factorial(i)" but I haven't seen it in this context.

kcrisman gravatar imagekcrisman ( 2011-03-30 16:40:08 -0500 )edit
parzan gravatar imageparzan ( 2011-04-02 12:25:46 -0500 )edit

By the way, wrapping the .txt file in standard HTML headers and <body> etc. then renaming that to html *might* work... just a random chance.

kcrisman gravatar imagekcrisman ( 2011-04-02 16:37:13 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2011-04-05 16:47:47 -0500

Jason Grout gravatar image

Try writing your output to an html file. Do something like:

f.write(some output)
f.write(some more output)

That file should appear as a link in the output of the cell. If you click on the link, you should see your output as an html file.

edit flag offensive delete link more


This could be helpful to have on the standard notebook help page as an FAQ or something.

kcrisman gravatar imagekcrisman ( 2011-04-06 02:29:47 -0500 )edit

answered 2012-03-13 09:05:15 -0500

akm gravatar image

I found this solves the problem: put this line in your notebook cell before you create output.


Worked for me.

edit flag offensive delete link more


This is very helpful! It can also be inserted in the definition of a function. A 2009 suggestion on the sage-support list was to change values of variables in the file devel/sage/sage/server/notebook/ and rebuild SAGE, which isn't feasible in many cases, such as when using SAGE in a classroom where it's been installed on multiple machines. Since there are pedagogical scenarios where we'd like all of the output to display, may I suggest that this solution be mentioned in the SAGE reference manual? (Searching for "notruncate" in version 6.4.1 of the manual produces three hits, none quite containing this solution.)

gtmarks gravatar imagegtmarks ( 2015-01-25 18:20:48 -0500 )edit

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2011-03-30 13:59:24 -0500

Seen: 1,871 times

Last updated: Mar 13 '12