Ask Your Question
1

how to produce graphics from cli

asked 2016-01-11 12:57:10 -0500

alienfetuseater gravatar image

updated 2016-01-11 16:30:11 -0500

i have just installed sage to ubuntu 15.10, and have been following along the 'tour of sage' and have been trying to get graphics to be produced from different functions, for example

sage: show(plot(sin(x) + sin(1.6*x), 0, 40))
Launched png viewer for Graphics object consisting of 1 graphics primitive

but not png viewer was launched. am i missing something?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2016-01-11 16:42:25 -0500

eric_g gravatar image

updated 2016-01-12 12:03:21 -0500

Unfortunately, the Sage 6.10 binary for Ubuntu 15.10 is somehow buggy (more precisely it is built with a version of gcc that is not too old with the respect to library libstdc++.so shipped with Ubuntu 15.10). This is a known problem, which will be solved in Sage 7.0. Meanwhile, a fix is indicated in this post: you have to type the following commands in a terminal (i.e. outside any Sage session)

cd SageMath/local/lib64
rm libstdc++.so.6
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6

Then the png viewer will be back at the next Sage session.

edit flag offensive delete link more

Comments

yeah that worked, now can you explain what just happened, and why that solution worked? new to ubuntu

alienfetuseater gravatar imagealienfetuseater ( 2016-01-11 17:47:57 -0500 )edit

The explanation is in Volker Braun's answer to the post linked to by @eric_g.

slelievre gravatar imageslelievre ( 2016-01-12 02:13:11 -0500 )edit
0

answered 2016-01-11 16:37:12 -0500

Could you try the following from Sage

sage:  from sage.misc.viewer import viewer
sage: viewer.png_viewer()
'xdg-open'

If your answer is different from 'xdg-open' above you should adapt the steps below.

  1. Make sure that xdg-utils is installed on your computer. You can do it via

    $ sudo apt-get install xdg-utils

  2. Try to open a png file with xdg-open, namely

    $ xdg-open my_picture.png

    where my_picture.png should be replaced by a picture you have on your computer

If the steps 1 and 2 above works but picture still do not show up from Sage, there is something fishy.

edit flag offensive delete link more

Comments

sage answers with 'xdg-open'

alienfetuseater gravatar imagealienfetuseater ( 2016-01-11 17:40:03 -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

Stats

Asked: 2016-01-11 12:57:10 -0500

Seen: 408 times

Last updated: Jan 12 '16