Group Abstract Group Abstract

Message Boards Message Boards

Wolfram Language graphics commands on a Raspberry Pi/Pi-top?

I am starting to learn Mathematica and Wolfram on a Raspberry Pi 3 with is the CPU for my Pi-top. Wolfram and Mathematica were supplied with the Pi-top operating system.

I am executing both from the console. The graphics commands, such as ListPlot, work very well when running Mathematica. When invoked in Wolfram they return -Graphics-.

How do I get them to work in both cases?

Carl

POSTED BY: Carl W. Entemann
9 Replies

That's the result one would get if the factorial[1]=1; part of the definition were skipped.

POSTED BY: Ilian Gachevski

Not sure what is going wrong because the post doesn't seem to show the entire definition, but try something like

In[1]:= Clear[factorial];
        factorial[1] = 1;
        factorial[n_Integer /; n > 1] := factorial[n - 1]*n

In[4]:= factorial[10]

Out[4]= 3628800

In[5]:= % == Factorial[10]

Out[5]= True

EDIT

Now I can see your post with a different browser -- the pattern head should just have been Integer instead of integer.

POSTED BY: Ilian Gachevski

Ilian:

Once again I am thanking you. You function definition gives the correct answer in Wolfram.

In Mathematica the result generated by factorial[10] using your definition is: 3628800 factorial[1]

Any reason for this?

Thanks again.

Carl

POSTED BY: Carl W. Entemann

Moving on to functions, I defined the factorial function as:

factorial[1]=1;factorial[n_integer]:=n*factorial[n-1]

factorial[1] returns 1, as it should.

factorial[10] returns factorial[10]

I have tried both Wolfram and Mathematica and have tried the alternative definition using If. Same result.

What am I doing wrong or what is wrong?

Carl

POSTED BY: Carl W. Entemann
POSTED BY: Ilian Gachevski
POSTED BY: Ilian Gachevski

Ilian:

<<JavaGraphics` does the job very nicely. I am thanking you.

Carl

POSTED BY: Carl W. Entemann

Ilian:

Now that I have ListPlot working I am trying the colors.

If I type Red I get RGBColor[1,0,0]

If i type Blend[{Yellow, pink, Green}] I get RGBColor[2/3, 0.833333, 0.166667]

I executed <<JavaGraphics` before all of these.

Can you help me with this problem?

Carl

POSTED BY: Carl W. Entemann
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard