Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MathKernel7 produces no Graphics

141 views
Skip to first unread message

Jan Engelhardt

unread,
Nov 4, 2009, 1:40:28 AM11/4/09
to
Hi everybody,


I just installed a trial of Mathematica 7.0.1 to see how it improved
from the previous Mathematica 5.2 that I still had. Slightly
disappointing is the fact that the MathKernel does not output graphics
anymore, that is,

> ~/bin/math
Mathematica 7.0 for Linux x86 (64-bit)
Copyright 1988-2009 Wolfram Research, Inc.

In[1]:= Plot[x^2, {x, -1, 1}]

Out[1]= -Graphics-

In[2]:=

Without popping up a new window with the graph as it used to in Math5.
$DISPLAY is set and valid. Even when I forcibly unset it, there is no
warning from the graphics output subprogram (that used to start in
Math5) that DISPLAY is empty.

I found this [ http://tinyurl.com/yfn47x2 ] thread in this newsgroup
archive mentioning similar issues; however, if directing MathKernel to
output in StandardForm or TraditionalForm, the -graphics- won't be a
-graphics-, but a point list and parameters of the plot (I'd really
prefer the drawn plot ;)

In[2]:= StandardForm[Plot[x^2,{x,-1,1}]]

Out[2]//StandardForm=

>GraphicsBox[... lots of text ...]

What could be up with MathKernel7 that it produces no Graphics? With the
graphical interface (~/bin/mathematica), plots are in fact shown, but
I really prefer running just the MathKernel CLI.


thanks,
Jan

Szabolcs Horvát

unread,
Nov 5, 2009, 4:18:50 AM11/5/09
to

About the only thing you'll achieve by using the cli only is limiting
yourself and making Mathematica less useful.

However, I'm aware that some Linux users think that it is "cool" to do
things the inconvenient and frustrating way, so you can try one of

<<Terminal`
<<JavaGraphics`
<<X11`

before using a plotting command.

I am not sure if the last one is included in Mathematica 7. You can
check the Mathematica\7.0\SystemFiles\Kernel\Packages directory for
other options.

Mathematica 7 generates graphics using the front end, so this will not
prevent the front end from running. It'll simply run it in the background.

Jan Engelhardt

unread,
Nov 5, 2009, 4:19:39 AM11/5/09
to

On Nov 4 2009 09:32, John Fultz wrote:
>
>You can load the JavaGraphics` package to get the support you want. I.e.,
>
><<JavaGraphics`
>[...]
>But the modern graphics are sophisticated enough that there's only
>one program with all of the features required to render them...the
>Mathematica front end.

Well I am fine with that. To reply to the other response, we run the
CLI kernel not because we are cool, but because it's faster to go,
especially when you run on netbooks and you happen to not require
graphic output.

>We wrote a quickie Java bitmap viewer and some M-- code to launch the FE in the
>background, ask the FE to render graphics to bitmap, then toss the bitmap to the
>Java program. But, as you'll notice when you execute the above command, it
>takes a bit to launch.

The problem I am observing is that despite <<JavaGraphics`, there will
be no graphics window.

I ran that in `strace -fe execve ./bin/math` now, and see there
a Segmentation Fault. Uh, not good :->


[pid 8328] execve("/home/math/Mathematica-7.0/SystemFiles/FrontEnd/Binaries/Linux-x86-64/Mathematica", ["/home/math/Mathematica-7.0/Syste"..., "-topDirectory", "/home/math/Mathematica-7.0", "-mathlink", "-server", "-noSplashScreen", "-linkmode", "connect", "-linkprotocol", "SharedMemory", "-linkname", "9mb_shm"], [/* 80 vars */]) = 0
-- Java graphics initialized --

In[2]:= Plot[x^2,{x,-10,10}]
Process 8386 attached
Process 8404 attached (waiting for parent)
Process 8404 resumed (parent 8260 ready)

General::unavail:
ExportString is not available in this version of Mathematica.

General::unavail:
ExportString is not available in this version of Mathematica.
[pid 8260] --- SIGSEGV (Segmentation fault) @ 0 (0) ---

Java::argx: Method named setSize defined in class com.wolfram.jlink.MathJFrame
was called with an incorrect number or type of arguments. The arguments,
shown here in a list, were {30 + Null[System rivate etWidth[]],
60 + Null[System rivate etHeight[]]}.
Process 8415 attached
Process 8416 attached
[pid 8404] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
[pid 8260] --- SIGSEGV (Segmentation fault) @ 0 (0) ---

Out[2]= -Graphics-

In[3]:= [pid 8234] --- SIGALRM (Alarm clock) @ 0 (0) ---

John Fultz

unread,
Nov 5, 2009, 4:24:22 AM11/5/09
to
You can load the JavaGraphics` package to get the support you want. I.e.,

<<JavaGraphics`

So why not do this by default? We had a sea change of graphics systems
beginning with v6. Previously, graphics were generated from PostScript created
largely by the kernel (although some components could be generated by the FE as
well). Any PostScript renderer could show them, and we had a few.

As of v6, the kernel no longer emits PostScript. This is a *good* thing, as
PostScript was holding our graphics ability back. But the modern graphics are

sophisticated enough that there's only one program with all of the features
required to render them...the Mathematica front end.

We wrote a quickie Java bitmap viewer and some M-- code to launch the FE in the

background, ask the FE to render graphics to bitmap, then toss the bitmap to the
Java program. But, as you'll notice when you execute the above command, it

takes a bit to launch. The FE has to be started up, as well as a JRE. People
who use standalone kernels might not appreciate the extra startup time,
particularly if the kernels are to be used non-interactively (i.e. as a target
for redirection).

Sincerely,

John Fultz
jfu...@wolfram.com
User Interface Group
Wolfram Research, Inc.


On Wed, 4 Nov 2009 01:39:49 -0500 (EST), Jan Engelhardt wrote:
> Hi everybody,
>
>

> thanks,
> Jan


Albert Retey

unread,
Nov 5, 2009, 4:26:31 AM11/5/09
to
Jan Engelhardt schrieb:

I think this has changed in version 6. You can get something similar to the
old default behaviour (an extra window which shows the graphics) with:

Get["JavaGraphics`"]

the former Motif-Graphics are not existent anymore, AFAIK.

hth,

albert

ritu...@gmail.com

unread,
May 9, 2014, 2:08:26 AM5/9/14
to
In version 8.0, Get["JavaGraphics`"] too doesnt work. What can be done?

0 new messages