Ask Your Question
1

How to get sage command line show() to generate other than .html?

asked 2022-10-23 00:18:46 +0100

bobgotbass gravatar image

HI. I'm using SageMath 9.5 from the Lubuntu 22.04 apt packages on a PC laptop. When I start sage from the gui menu it opens jupyter and I can enter the following code and everything works.

G = tetrahedron((0,-3.5,0), color='blue') + cube((0,-2,0),color=(.25,0,.5))
G += octahedron(color='red') + dodecahedron((0,2,0), color='orange')
G += icosahedron(center=(0,4,0), color='yellow')
G.show(aspect_ratio=[1,1,1])

However, when I enter the same code in the command-line sage, I get an access denied error from firefox. I think this might have to do with firefox being a snap package by default now on Lubuntu 22.04. But my real question is how do I get the above code to show in its own window (is "natively" the right term?) without have to invoke the web browser? I want to avoid running firefox for sage so I would prefer to use the terminal, avoiding jupyter and displaying my plots without running the browser. Any help would by greatly appreciated. BTW, I am not yet proficient in python so please explain to me like I'm 5 years old. Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-10-23 04:46:06 +0100

You could try G.show(viewer='tachyon') or G.show(viewer='jmol'). Those should not open a browser.

edit flag offensive delete link more

Comments

Excellent!! Thank you, John! Tachyon didn't work, even though it's installed, but jmol works perfectly! P.S. Your response hasn't yet registered on the main question board; I only saw it because I clicked on the question just on a whim - three hours late or I would have thanked you sooner. Anyway, thanks again!

bobgotbass gravatar imagebobgotbass ( 2022-10-23 07:56:47 +0100 )edit

For the record, the Firefox access denied issue for 3D plots from the console is tracked at https://trac.sagemath.org/ticket/34593

eric_g gravatar imageeric_g ( 2022-10-23 11:14:41 +0100 )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: 2022-10-23 00:18:46 +0100

Seen: 185 times

Last updated: Oct 23 '22