3
$\begingroup$

I just now powered on my new Raspberry Pi for the first time and tried the supplied Mathematica (Wolfram Language).

One thing I tried was

Plot[x, {x, 0, 1}]

Which gave me a -Graphics- with no output. So far not surprising as the same happens when I do the same on an 8.0 kernel on a regular Linux PC. So I tried on a fresh session:

<<JavaGraphics`

which almost immediately gave me

First::nofirst: {} has a length of zero and no first element.

However after a while I get nevertheless

-- Java Graphics initialized --

However the plot command above now gives me:

Java:excptn: A Java exception occurred: java.lang.NullPointerException.

Java::argx: Method names 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`Private`getWidth[]],
      60 + Null[System`Private`getHeight[]]}.

and only a mini-window is opened which is too small to see anything in it, and when resizing it the content is just white.

So is there a way to get function plots on the Raspberry Pi?

$\endgroup$
5
$\begingroup$

You need to run Mathematica, not Wolfram Language. There is a real Mathematica with the notebook interface on the Raspberry Pi. This guide may help.

Below is Door Number One and Door Number Two. You want to use Door Number Two to plot and other notebooky things.

Wolfram on left, Mathematica on right

The Mathematica icon should be on your desktop or under Education. If not, you may have the same configuration error I ran into a while back. I posted a solution on the RaspberryPi forum, that is copied here:

Edit this text file (with sudo so you can save it): /usr/share/applications/wolfram-mathematica.desktop

Add a line at the end:

StartupNotify=true

The Mathematica icon to open the notebook interface will then appear in the Education menu (along with Wolfram, which is the command line kernel interface).

Then you can right-click the Mathematica in Education and then click on Add to Desktop.

By the way, it's dog slow, but what do you expect for $35?

$\endgroup$
  • $\begingroup$ Ah, thank you, I didn't notice that. After I've seen the "Wolfram" Icon, I didn't think of searching for another icon ;-) I now found the notebook interface, and there plotting indeed works fine. $\endgroup$ – celtschk Oct 18 '14 at 22:14
  • $\begingroup$ The Wolfie icon runs what was previously known as the Mathematica kernel. $\endgroup$ – Mark Adler Oct 18 '14 at 22:18
  • $\begingroup$ Yes, I noticed that. Given that it came with the RPi for free, it didn't strike me as odd. Especially since you normally can do everything also with the kernel interface, just less comfortably. $\endgroup$ – celtschk Oct 18 '14 at 22:22
  • $\begingroup$ Not necessarily that slow: Use the RPi-Mathematica frontend for editing your notebook, save it and then open it on your full fledged PC via a local network connection inside of a browser with the mathematica cdf plugin. Save your changes in the notebook on your RPi and refresh the browser as you go. $\endgroup$ – yippy_yay Jan 2 '15 at 23:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.