I don't think this is fixed in 2016.1, which now is available for download, so you need to use the command-line approach for a while still. Alternatively, and perhaps better, is to modify the plot statements in the script, so instead of popping up the plot, just save it to a file. To do this, change
pylab.show()
to
pylab.savefig("plot.png")