Why is this semicolon in red?
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:
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.
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
: