help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: saving plot to file, Ghostscript collision error?


From: Ben Abbott
Subject: Re: saving plot to file, Ghostscript collision error?
Date: Fri, 15 Jun 2012 22:26:15 -0400

On Jun 15, 2012, at 10:14 PM, Nicholas Jankowski wrote:

> Using Octave3.6.2gcc4.6.2 on windows (mingw) running the same octave
> script on separate cores for some brute force 'parallel processing', I
> have the script generate and save a bunch of plots as it goes along.
> Done this a number of times, and this was the first I noticed the
> following error message popping up:
> 
> -----
> GPL Ghostscript 9.05: Unrecoverable error, exit code 1
> The process cannot access the file because it is being used by another 
> process.
> -----
> 
> Octave continues with the loop, running followon iterations. Looking
> in the output folder, a couple of the plot files are missing. others
> are there but missing elements (usually the plot is there but the
> label I put on each graphic is missing).
> 
> certain scripts run faster, so in the past the different processes
> usually hit this part of the script at different times. this time I
> restarted them all at this spot, and noticed all of these error
> messages.
> 
> So, is ghostscript using some temporary files to generate plot images
> and I can't have separate Octave instances calling it?
> 
> here's the sloppy code creating the two plots per iteration. I think
> the jpg one is the one that runs into problems
> 
> fig1=plot(ZZ,normtemps,"*");
> hold on;
> plot(sortedtrue(:,1),sortedtrue(:,2),"linewidth",3,'k');
> axis('square');
> text(get(gca(),"xlim")(2)*.75,get(gca(),"ylim")(2)*.75,"stringtoprinthere");
> hold off;
> saveas(fig1,"filenamehere",".jpg"));
> 
> fig3=plot(anasteptimes,xxana_l,"b",steptimes,xx,"xr"); axis("square");
> text(get(gca(),"xlim")(2)*.75,get(gca(),"ylim")(2)*.75,"stringtoprinthere");
> saveas(fig3,"filenamehere",".emf"))


Octave does use temporary files when printing, but their names have random 
content, so there should be no conflict.

Are the different instances of Octave trying to save a figure to the same file 
name?

Are you able to determine the name of the file that ghostscript cannot access?

Ben




reply via email to

[Prev in Thread] Current Thread [Next in Thread]