Ask Your Question

zwdnet's profile - activity

2020-07-07 11:00:26 +0100 received badge  Taxonomist
2015-01-28 02:02:14 +0100 received badge  Famous Question (source)
2013-02-22 11:07:22 +0100 received badge  Notable Question (source)
2012-08-23 03:57:15 +0100 received badge  Good Question (source)
2012-08-20 01:19:22 +0100 received badge  Popular Question (source)
2011-11-30 08:35:39 +0100 commented answer How to change the default program which open the 2D picture which the plot producted?

Thank you very much, John!

2011-11-29 20:38:01 +0100 received badge  Nice Question (source)
2011-11-29 19:20:42 +0100 commented answer How to change the default program which open the 2D picture which the plot producted?

Thank you for your help! It works perfectly! I'm sorry I didn't see the comment function so I posted 2 answers.

2011-11-29 19:16:50 +0100 marked best answer How to change the default program which open the 2D picture which the plot producted?

Hi! On Ubuntu, I think Sage finds xdg-open and uses that, so it'll use whatever xdg-open is set to use to view pngs.

It looks like Sage calls sage.misc.viewer.browser() instead of sage.misc.viewer.png_viewer() even when it knows that the file is a png.

You can change the default viewer by typing

sage.misc.viewer.BROWSER = 'gpicview'

at the command line. (This may cause problems for anything which uses BROWSER but which gpicview can't handle, though..)

UPDATE:

If you want this to be the new default setting, you can add the above line to ~/.sage/init.sage:

localhost-2:~ $ cat ~/.sage/init.sage
# personal options
sage.misc.viewer.BROWSER = 'gpicview'

The init.sage file is executed at startup time.

2011-11-29 19:16:50 +0100 received badge  Scholar (source)
2011-11-29 19:14:17 +0100 answered a question How to change the default program which open the 2D picture which the plot producted?

Haha, I find the answer! Put the

sage.misc.viewer.BROWSER = 'gpicview'

in the $HOME/.sage/init.sage file (If there isn't init.sage, create it), so I needn't type it every time when I run SageMath. I fount the answer in this web

http://comments.gmane.org/gmane.comp....

by google! Thank DSM!

2011-11-29 19:01:53 +0100 answered a question How to change the default program which open the 2D picture which the plot producted?

Thank you very much! It works! But I still have a problem: When I typed sage.misc.viewer.BROWSER = 'gpicview' at the sage command line, and called plot to draw picture again, the display program was changed to gpicview. That's what I want. But when I typed "quit" to exit the sage and ran sage command again, the display program was backed to evince again! How to change the sage.misc.view.BROWSER value forever? Or do I need to type this every time when I run SageMath?

2011-11-29 13:29:48 +0100 received badge  Student (source)
2011-11-29 09:04:10 +0100 asked a question How to change the default program which open the 2D picture which the plot producted?

I'm using SageMath4.7.2 in Ubuntu10.04. When I called the plot() to draw the 2D picture of some functions in command line of SageMath(not the GUI session in web browser), SageMath show the pictures in evince,which is my PDF files reader. My default picture viewer in Ubuntu is set to gpicview, not evince. When I delete the evince?SageMath call the ImageMagic to display the result. But I need evince to read ebooks, so I installed the evince again. After that the SageMath still call evince to display the 2D pictures. I wonder are there any method to change the default program to open the 2D pictures in SageMath? PS: My mother language is Chinese, not English, so please forgive me for my language errors. Thanks!