I want to produce some plots/graphics for a large amount of data on a computing cluster in a high-throughput way. I'd like to do this by piping results through Mathematica where I'd apply some post-processing to generate some visualizations - PNGs, JPEGSs, GIFs, etc. - and send these results back to my personal computer.

But I have no idea where to start with this. Is the correct answer WolframScripts? Does the cluster need extra Mathematica software modules for this sort of functionality?

Searching around has yielded some opaque results. Any suggestion/answer pointing me in the right direction is appreciated.

  • $\begingroup$ call-a-mathematica-program-from-the-command-line $\endgroup$
    – Johu
    Commented Sep 19, 2018 at 23:07
  • $\begingroup$ Check out the command line tag. It has many related questions. $\endgroup$
    – Johu
    Commented Sep 19, 2018 at 23:10
  • $\begingroup$ Scripting tag is even better. $\endgroup$
    – Johu
    Commented Sep 19, 2018 at 23:11
  • $\begingroup$ You do not need any additional packages. It is more or less the same on all operating systems. Hope, that my links get you started. This question itself is probably too broad and duplicates other. Perhaps you want to come back later with more specific questions. $\endgroup$
    – Johu
    Commented Sep 19, 2018 at 23:14
  • 1
    $\begingroup$ Related : mathematica.stackexchange.com/questions/136574/… $\endgroup$
    – chris
    Commented Sep 20, 2018 at 0:16

1 Answer 1


Since the answer is found not in a single 'duplicate', but multiple ones, here's a summary:

  1. Do not use notebooks. Transfer the code to a plain text .m file.

  2. You can run is as math -script myfile.m. You could also use wolframscript. Full info at Wolfram Language Scripts

  3. Since you're running on a headless Linux machine, and want to export graphics, you'll need to manually ensure that an X server is present:


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