No plot with plot3d

514 views
Skip to first unread message

Ari

unread,
May 19, 2011, 5:47:20 AM5/19/11
to sage-devel
Hi everybody,
I know that it is a topic already discussed earlier
but
I didn't find the solution to my problem. I am working with sage
from the terminal and whenever I use the function plot3d, nothing
happens. It was not working under sage-4.2, and it is not working
neither with the pre-compiled version of sage-4.6.2 I just
downloaded.
There is no error message, there is a small delay when using the
plot3d
function as if there is something in process, but then nothing
happens.
I am working on a MacBook Mac OS X 10.5.8, Intel.
Is anyone can help me?
Thanks,
Ari

RegB

unread,
May 19, 2011, 8:30:10 AM5/19/11
to sage-devel
This looks at least a LITTLE BIT like the trouble I am having under
UBUNTU 11.04
I am running within VirtualBox under Windows Vista on an amd64 laptop,
which has worked very well previously.
Plot3d has worked for me in previous releases of SAGE and VirtualBox
with various distros of Linux, mostly Debian and UBUNTU (Debian
based).
The applet seems to be JMOL (?) but I get lost when I try to trace
through what makes up the calls and what is passed in the process.

Oracle(/Sun) just released VirtualBox 4.0.8, which I am downloading
NOW.
I doubt that updating from 4.0.6 will have any effect on THIS problem.
Point is the success of plot3d DOES seem to be platform dependent.

No difference on VB 4.0.8

kcrisman

unread,
May 19, 2011, 9:01:08 AM5/19/11
to sage-devel
Often problems with plot3d boil down to Java issues. There is also
another issue that has been fixed in the 4.7 series (see
http://trac.sagemath.org/sage_trac/ticket/9232) that had to do with
this; 4.7.rc2 (which will probably be nearly identical to the released
4.7) has this fix. Or you could just import the patches from that
ticket.

Also, you can always use (the not as well documented as should be)

plot3d(....).show(viewer='tachyon')

or use viewer='canvas3d' when you are in the notebook. (I think
that's the right syntax.)

- kcrisman

RegB

unread,
May 19, 2011, 11:18:24 AM5/19/11
to sage-devel
Although I have only been running UBUNTU 11.04 for a week or two
there are about 112 meg of updates outstanding, at least two of which
are to Firefox.
I am updating in the hope that java MIGHT be incidentally fixed and
will
try again.
Failing that I will probably try 4.7 - might even wait for the
"official" release.


On May 19, 9:01 am, kcrisman <kcris...@gmail.com> wrote:
> Often problems with plot3d boil down to Java issues.  There is also
> another issue that has been fixed in the 4.7 series (seehttp://trac.sagemath.org/sage_trac/ticket/9232) that had to do with

kcrisman

unread,
May 19, 2011, 12:31:07 PM5/19/11
to sage-devel


On May 19, 11:18 am, RegB <2regburg...@earthlink.net> wrote:
> Although I have only been running UBUNTU 11.04 for a week or two
> there are about 112 meg of updates outstanding, at least two of which
> are to Firefox.
> I am updating in the hope that java MIGHT be incidentally fixed and
> will
> try again.
> Failing that I will probably try 4.7 - might even wait for the
> "official" release.

You could try starting Sage and then doing

sage: hg_sage.apply('http://trac.sagemath.org/sage_trac/raw-attachment/
ticket/9232/trac_9232_call_jmol_correctly.patch')

then quitting, doing

sage -br

and then seeing what happens.

- kcrisman

RegB

unread,
May 19, 2011, 2:52:37 PM5/19/11
to sage-devel
Thanks, I tried that and it is no better.
I would REALLY like to help with this IF it is a bug, but there is
at least a chance that I have some other system problem(s)
and/or that have a bad build.
Since 4.7 is "imminent" it probably isn't worth re-building
4.6.2, trying to re-create the problem, wading through logs, etc.
So I think I will shelve this for now and report back if it is still
present with 4.7.

Kelvin Li

unread,
May 19, 2011, 5:46:06 PM5/19/11
to sage-devel
Please excuse me for pulling the subject of this discussion back to
what I think the original post meant...

On May 19, 2:47 am, Ari <garon.ari...@gmail.com> wrote:
...
> I am working with sage
> from the terminal and whenever I use the function plot3d, nothing
> happens.
...
> Ari

As far as I know, the usual "jmol" and "canvas3d" rendering engines
will not work from the command line. But, you can save your plot as a
PNG, as rendered by Tachyon:

sage: var('x y')
(x, y)
sage: plot3d(x^2 + y^2, (x, -1, 1), (y, -1, 1)).save("test.png")

The above example will save "test.png" to your current working
directory.

As an aside, you can also export your 3d object in various formats.
One example is the "obj" method, whose output can be viewed in Blender
(www.blender.org).

sage: var('x y')
sage: a = plot3d(x^2 + y^2, (x, -1, 1), (y, -1, 1))
sage: f = open("dump.obj", "w")
sage: f.write(a.obj())
sage: f.close()

After downloading and installing Blender (which is very easy to do),
do "File > Import > Wavefront (.obj)" and select the file "dump.obj".

-- Kelvin

Justin C. Walker

unread,
May 19, 2011, 7:06:51 PM5/19/11
to sage-...@googlegroups.com

On May 19, 2011, at 14:46 , Kelvin Li wrote:

> Please excuse me for pulling the subject of this discussion back to
> what I think the original post meant...

:-}

> On May 19, 2:47 am, Ari <garon.ari...@gmail.com> wrote:
> ...
>> I am working with sage
>> from the terminal and whenever I use the function plot3d, nothing
>> happens.
> ...
>> Ari
>
> As far as I know, the usual "jmol" and "canvas3d" rendering engines
> will not work from the command line.

I can't say for sure about 'canvas3d' (the docstring for '.show()' says notebook only), but with this

> sage: var('x y')
> sage: a = plot3d(x^2 + y^2, (x, -1, 1), (y, -1, 1))

a.show()

using sage from the command line (shell) does produce a 'jmol' window, with all the 3D goodness (at least on Mac OS X).

Justin


--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Enhancement of the Director's Income
--------
When LuteFisk is outlawed,
Only outlaws will have LuteFisk
--------

RegB

unread,
May 20, 2011, 6:15:29 PM5/20/11
to sage-devel
From the fact that plot3d worked previously from the terminal and that
2d plots still work from the terminal with UBUNTU 11.04
I think we are still on track, i.e. in my case it is plot3d specific
and fails whether called from a terminal or a notebook.

Jonathan

unread,
May 21, 2011, 10:26:22 AM5/21/11
to sage-devel
Which java do you have installed? The default with Ubuntu is
IcedTea. Last time I checked this was working with the patch, but
that could be the problem. Jmol (the 3D application that is launched)
is only verified against the Oracle/Sun JavaVM. If you are using
IceTea try switching to the Oracle/Sun release.

I just destroyed my Ubuntu VM so can't check this right now.

Jonathan

Jonathan

unread,
May 21, 2011, 10:36:25 AM5/21/11
to sage-devel
OK, I found an Ubuntu VM (11.04) that I hadn't killed. With the patch
for launching Jmol from the command line and the Sun Java it
definitely works. If you want 4.6.2 to work apply the patch. If that
doesn't fix it you will also have to switch from the default JavaVM to
the Sun/Oracle version.

Jonathan

Jonathan

unread,
May 21, 2011, 10:51:55 AM5/21/11
to sage-devel
OpenJDK VM (used to be IceTea) is the default with Ubuntu and it does
work with Jmol. So if things don't work after the patch there is
something else wrong with your installation.


Jonathan

Thierry Dumont

unread,
May 21, 2011, 1:23:25 PM5/21/11
to sage-...@googlegroups.com
Le 21/05/2011 16:36, Jonathan a �crit :

> OK, I found an Ubuntu VM (11.04) that I hadn't killed. With the patch
> for launching Jmol from the command line and the Sun Java it
> definitely works. If you want 4.6.2 to work apply the patch. If that
> doesn't fix it you will also have to switch from the default JavaVM to
> the Sun/Oracle version.
>
> Jonathan
>

Apologize, but I am new in this discussion thread.
After upgrading my Unbuntu to the last version (April 2011),
Jmol was no more working.
Solution:
dpkg -l|grep icedtea
remove all these packages.
Same thing with all OpenJDK packages.

Then:
apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
restart the browser.
It works!

t.d.

tdumont.vcf
Reply all
Reply to author
Forward
0 new messages