# How to execute a Mathematica notebook in a shell script to produce plots/graphics [duplicate]

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.

• call-a-mathematica-program-from-the-command-line – Johu Sep 19 '18 at 23:07
• Check out the command line tag. It has many related questions. – Johu Sep 19 '18 at 23:10
• Scripting tag is even better. – Johu Sep 19 '18 at 23:11
• 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. – Johu Sep 19 '18 at 23:14
• – chris Sep 20 '18 at 0:16

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