First time here? Check out the FAQ!

Ask Your Question
2

Why is a png viewer not loading?

asked 2 years ago

OpenSauceCool gravatar image

updated 2 years ago

FrédéricC gravatar image

Question 54175 is the same issue highlighted previously without solution.

This is so frustrating as it's the first time I'm using Sage and the whole process has been incredibly annoying to set up and I can't even view my plot!

I'm using SageMath 9.6, using Ubuntu on Windows.

Here's my code:

sage: vector_field(X, Y) = (0.9*X - 0.5*Y, 0.1*X + 0.8*Y)
sage: p = plot_vector_field(vector_field,
....:                       (X, -2, 2), (Y, -2, 2),
....:                       frame=False,
....:                       color="green",
....:                       plot_points=10,
....:                       axes_labels=("$X$", "$Y$"))
sage: show(p, aspect_ratio=1, figsize=5)
Launched png viewer for Graphics object consisting of 1 graphics primitive

But no png viewer is launched!

Preview: (hide)

Comments

2

are you using Virtual box or WSL? For WSL, Did you install X11 for windows and configure it? "Install a X server for Windows Configure bash to tell GUIs to use the local X server" see https://seanthegeek.net/234/graphical... as an example and this page https://discourse.ubuntu.com/t/gettin... and also see Mircosoft WSL pages on how to do this.

Nasser gravatar imageNasser ( 2 years ago )

Using WSL. I tried configuring following the first link, but I get the error Can't open display: localhost:0.0.

OpenSauceCool gravatar imageOpenSauceCool ( 2 years ago )

1 Answer

Sort by » oldest newest most voted
3

answered 2 years ago

ortollj gravatar image

Another solution is to use Jupyter notebook (here Ubuntu WSL in W11) image description

Preview: (hide)
link

Comments

After install jupyter notebook, I run the code ./sage -n jupyter
To open a jupyter notebook with sage, this works. Many thanks!

OpenSauceCool gravatar imageOpenSauceCool ( 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: 771 times

Last updated: Sep 07 '22