Ask Your Question
1

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

asked 2 years ago

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.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 2 years ago

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

Preview: (hide)
link

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 ( 2 years ago )

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 ( 2 years ago )

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: 2 years ago

Seen: 241 times

Last updated: Oct 23 '22