Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a piece of code that works well, but when I put a semicolon after a plotting statement, the semicolon appears in red. What's the error?

share|improve this question
It's not about the Print, it's just that you prevent a Plot to be plotted, so it appears red. – Öskå May 1 '14 at 10:06
It's all about Plot not being plotted I guess. With or without ;, Print is printed. Check this. – Öskå May 1 '14 at 10:22
Your screenshot is really tiny and hard to read. – Yves Klett May 1 '14 at 10:56
@OleksandrR. in any case the displayed version is neigh unreadable unless magnified. Agreed on the ample whitespace though. – Yves Klett May 1 '14 at 11:25
@OleksandrR.: That reason is typography. Most typographers agree that somewhere around 45-75 characters per line is optimal for long passages. The web has spoiled us somewhat in that regard - we've now grown more accustomed to wider measures (and unserifed faces). For instance, StackExchange, on my system, renders at about 100 characters per line, which is really near the border of too wide a measure. – Reid May 1 '14 at 19:20
up vote 12 down vote accepted

It's not a syntax mistake. Consider it a suggestion, FrontEnd tells you: "maybe you want to plot it as it has no much sense now".

Of course it may have sense, it's just a suggestion.

If you take a closer look you will find that storing such Plot makes more sense for FE:

enter image description here

share|improve this answer

A bit of historic background

Before Mathematica version 6 graphics were produced as a side-effect much as Print works now. In fact you can load this old system using:

<< Version5`Graphics`

Now you get this behavior:

enter image description here

Note that the output is - Graphics - and the plot itself is handled like Print. Since there was often little value in having - Graphics - output it was common to see plot statements terminated with a semicolon, which returns Null which is not written to the Notebook.

In version 6 syntax highlighting of that trailing semicolon was added to remind people that with it no output at all would be produced, since the Graphics object is no longer printed as a side-effect.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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