Issue
partially solved : Works in jmol trough Sage CLI
3D plot remains blank in SageMath in Jupyter Notebook
Edit: This problem still remains unsolved, I have tried to even boot into a different OS (Debian instead of Kali) (not using anaconda, will (hopefully) get more time to try that)
As the title describes and illustrated by this screenshot:
Instead of the expected 3D plot, just a white plain background with a question mark in it, that, when clicked, displays a menu like this:
I have now experimented quite a bit on this example (on my system) and... to give an example:
This shows just a black square (while it's supposed to show a sphere):
sage: u = var('u')
sage: circle = (cos(u), sin(u))
sage: rp = revolution_plot3d
sage: rp(circle, (u, 0, 2*pi), axis=(0, 0),
....: show_curve=True, opacity=0.5).show(aspect_ratio=(1, 1, 1))
The following code is (I guess) a bit better, but still not really "as it should be", or "as expected":
sage: u = var('u')
sage: circle = (cos(u), sin(u))
sage: rp = revolution_plot3d
sage: rp(circle, (u, 0, 2*pi), axis=(0, 0), frame=False,
....: show_curve=True, opacity=0.5).show(aspect_ratio=(1, 1, 1))
(Change: include frame=False
somewhere in the last line).
Inspiration
I am trying to recreate this 3D plot from the SageMath documentation:
Info/Logs:
SageMath version:
SageMath version 9.2, Release Date: 2020-10-24
OS: Kali Linux
SageMath installed via
apt
:sudo apt-get install sagemath
I do not need to "get" this solved anytime soon, Right now I am mostly doing matrix operations, and such. so - there is no "hurry" with coming up with a solution here! It would just be a [plus+] to be able to do as the problem describe, but it is not necessary.
Any help is greatly appreciated! Thanks!
Solution
MAJOR UPDATE:
To not introduce false hope to the future readers: I have NOT solved it in Jupyter notebook.
But
I have (probably) fixed it with a viewer, my system had Jmol pre installed; (probably because I liked it before, and did some exercises with it, as in Matlab)
The (partial) solution:
But here is the thing, when I access a SAGE terminal (bash -> sage
) and for example, plotting something that normally would just result in either white - or a black screen in Jupyter whatever I tried to do to make it work;
It opens up a jmol window (the, actual application - Jmol)
and plots it.
I did not know it was this easy to get Jmol and sage math to work together (a actual fact; I did not even know this was possible.
Screenshots
here are a few screenshots (Jupyter - black screen, and the exact same code - but run from Sage Terminal
Same code, but in Sage terminal:
(Identical results) (Which, was for me impossible, even at times where I could (In Jupyter) (ugly)-plot it, it didn't show the expected results, (colors were a bit distorted, and the form had very little in common with the actual plot Sage Docs was showing)
To be honest, I think - I like this more, even if Jupyter would've got to work (maybe some time in the future) This - jmol application has some really neat properties, (color, axis's, and animations (rotation) and other stuff) I did really not know this at all; In Jupyter one maybe could rotate it with the mouse and zoom in, but not really change color, easily - (Not saying this is more expected result, but In my opinion - in my scenario - This was one, (*)good workaround, If not a actual solution, (In my case I will continue this way, it's flawless)
Hopefully this is helpful for someone in the future!
Answered By - William Martens
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.