Question: Error, (in plottools:-exportplot) exported file Test.jpg could not be created

The following code works in one worksheet but not in another (where it returns the error in the title). What could be the reason?

[> restart:
    P:=display(polygonplot([[0,0],[0,1],[1,1],[1,0]], color=red,axes=none,style = polygon)):
[> exportplot("Test.jpg",P, plotoptions="height=30,width=30,quality=90");

In the worksheet (.mw) where it does work, I can't put the code in one command line unless the file is already there, in which case it overwrites.

Please Wait...