Page 1 of 1

No plots

Posted: Sat Nov 23, 2013 12:08 pm
by yewtc
I am getting nothing displayed from a plot command. I am using vnc to access the desktop remotely, but nothing gets displayed. Am I missing a "standard" image viewer? I get no diagnostics, Merely :
Out[6]= -Graphics-

Steve

Re: No plots

Posted: Sat Nov 23, 2013 1:38 pm
by geev03
Have a look under /home/... that is where I saw mine. i.e. after executing a ' In[7]:= Export["abcd.png",p] ', search for abcd.png .
Image

Re: No plots

Posted: Sat Nov 23, 2013 6:04 pm
by yewtc
That's helpful, but I was expecting "Show" to work - which is doesn't. At least not for me.

Steve

Re: No plots

Posted: Sat Nov 23, 2013 7:51 pm
by DougieLawson
Try following the Mathematica 101 lessons http://www.wolfram.com/broadcast/screen ... dsonstart/

Re: No plots

Posted: Sat Nov 23, 2013 9:00 pm
by MoosePi
DougieLawson wrote:Try following the Mathematica 101 lessons http://www.wolfram.com/broadcast/screen ... dsonstart/
I was interested but could not view the web page because it requires Flash Player, great !!

Re: No plots

Posted: Sat Nov 23, 2013 9:16 pm
by DougieLawson
MoosePi wrote:
DougieLawson wrote:Try following the Mathematica 101 lessons http://www.wolfram.com/broadcast/screen ... dsonstart/
I was interested but could not view the web page because it requires Flash Player, great !!
Works for me on my Win81 machine.

Re: No plots

Posted: Sun Nov 24, 2013 11:47 am
by mpwagner
I run Rasbian with X over HDMI
and ran the default Mathematica install
put get:

In[3]:= p=Plot[Sin[x],{x,0,2 Pi}]
Out[3]= -Graphics-
In[4]:= Export["testplot.png",p]
Developer`LaunchFrontEnd::nxsrv: An x server is required for that operation.
Rasterize::nofe: A front end is not available; Rasterize requires a front end.
Out[4]= $Failed

Does anybody have an idea what's wrong in the configuration?
(I'm not an linux expert, sorry!)

Many thanks - mpw

Re: No plots

Posted: Mon Nov 25, 2013 8:56 pm
by sharix
It seems you have no X server running (or that Mathematica does not detect it). See this discussion on how to work with graphics without an X server: http://www.raspberrypi.org/phpBB3/viewt ... 94&t=61501

Re: No plots

Posted: Mon Nov 25, 2013 9:27 pm
by Arnoud
Steve,

After you install the 'wolfram-engine' package with apt-get, there are two commands that launch an interface to the Wolfram Language:
  • wolfram -- which launches a simple text only interface in your shell.
  • mathematica -- which launches a desktop application interface.
The text interface launched with 'wolfram' does not display graphics (it just shows -Graphics- in the output); you can still export those graphics (as gif, png, jpeg, etc).

The desktop application interface does display graphics in its windows (called notebook documents).

Re: No plots

Posted: Sun Dec 22, 2013 7:14 pm
by DixonB
If you're only seeing Wolfram under the Education submenu (and not Mathematica), you might try installing another program. For some reason, at least on my version of Rasbian, installing wolfram-engine only places the Wolfram link in the menu system. Installing another piece of software (like emacs, for instance), updates the menu so Mathematica appears. Magic! Once you launch Mathematica, you should have no problem displaying graphics. Don't forget, however, to press <Shift><Return> to process your command.

I'm using a very old reference to Mathematics, version 2.0, but am amazed to see that almost all the commands from that era (almost 20 years ago) still work. A few packages have been replaced or updated but otherwise it runs great on my Pi. In fact, this free distribution of Mathematica is worth the price of the system.

Re: No plots

Posted: Tue Feb 21, 2017 3:28 pm
by algorithm
Arnoud wrote:The text interface launched with 'wolfram' does not display graphics (it just shows -Graphics- in the output); you can still export those graphics (as gif, png, jpeg, etc).
This does not work for me. I connect via SSH to a headless Pi with hdmi_force_hotplug=1 / hdmi_group=2 / hdmi_mode=85 in /boot/config.txt to enable VNC connections. I then start the text-based Mathematica interface with "wolfram". Plot output displays as "-Graphics-" as expected. But Export["plot.png",p] fails with "Can't open display :25". I then have to use ^C leading to "Interrupt during LinkConnect>" and type "quit" to return to the shell prompt. It works well via VNC but everything is muuuuch sloooowerrrrrr, of course, so I wanted to use the text-based interface via ssh.

Re: No plots

Posted: Sun Feb 26, 2017 11:27 am
by algorithm
algorithm wrote:This does not work for me. I connect via SSH to a headless Pi with hdmi_force_hotplug=1 / hdmi_group=2 / hdmi_mode=85 in /boot/config.txt to enable VNC connections. I then start the text-based Mathematica interface with "wolfram". Plot output displays as "-Graphics-" as expected. But Export["plot.png",p] fails with "Can't open display :25". I then have to use ^C leading to "Interrupt during LinkConnect>" and type "quit" to return to the shell prompt. It works well via VNC but everything is muuuuch sloooowerrrrrr, of course, so I wanted to use the text-based interface via ssh.
Apparently this got fixed in the apt-get dist-upgrade of Mathematica I got yesterday! There is also a new "wolframscript" program, so this works a treat and is just what I needed:

Code: Select all

wolframscript -c 'Export["plot.png",Plot[Sin[x],{x,0,2 Pi}]]'
(The ExportString example from the wolframscript man page didn't work for me, or rather it resulted in unreadable images.)