I am trying to run a .m file with wolfram script. I use the command

wolframscript -file name.m

It works until the program arrives to a Plot. I know that with wolfrascipt I cannot produce a graphic on screen as with the front-end, so I tried to suppress the output with a ;, as follows:


and later to Export plot, but it still does not run.

How do I produce and save a plot with wolframscript?

  • $\begingroup$ I forgot: I use Ubuntu 22.04 $\endgroup$
    – mattiav27
    Mar 7 at 20:15
  • 3
    $\begingroup$ What do you mean by "it does not run"? Can you show the screenshot from the command line? Writing plot=Plot[Sin[x],{x,-Pi,Pi}]; Export["test.png", plot]; should produce a valid output image ... $\endgroup$
    – Domen
    Mar 7 at 20:19


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.