From: Eric E. <ems...@ob...> - 2006-10-17 15:43:18
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> <pre wrap="">Hi, I have a problem saving eps files in certain conditions. Unfortunately I am unable to find a simple example which may be very illustrative here to show you when it works and when it does not. I include the error message below and so the question is: does anybody have a hint of why the savefig fails and crashes? (I tried to close('all'), rcdefaults, etc). thanks for any input, Eric =================<span class="moz-txt-citetags"> >> </span>savefig('toto.eps') </pre> <pre wrap=""><!----> Your figure is too big to fit on a4 paper. b4 paper will be used to prevent clipping. AFPL Ghostscript 8.51: Unrecoverable error, exit code 1 --------------------------------------------------------------------------- exceptions.NameError Traceback (most recent call last) /home/science/Sauron/AnalysisKin/Paper7/<ipython console> /usr/local/lib/python2.4/site-packages/matplotlib/pylab.py in savefig(*args, **kwargs) 809 def savefig(*args, **kwargs): 810 fig = gcf() --> 811 return fig.savefig(*args, **kwargs) 812 if Figure.savefig.__doc__ is not None: 813 savefig.__doc__ = _shift_string(Figure.savefig.__doc__) /usr/local/lib/python2.4/site-packages/matplotlib/figure.py in savefig(self, *args, **kwargs) 673 kwargs[key] = rcParams['savefig.%s'%key] 674 --> 675 self.canvas.print_figure(*args, **kwargs) 676 677 def colorbar(self, mappable, cax=None, **kw): /usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtkagg.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, **kwargs) 112 try: 113 agg.print_figure(filename, dpi, facecolor, edgecolor, --> 114 orientation, **kwargs) 115 except IOError, msg: 116 error_msg_gtk('Failed to save\nError message: %s'%(msg,), self) /usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, **kwargs) 486 ps = self.switch_backends(FigureCanvasPS) 487 ps.print_figure(filename, dpi, facecolor, edgecolor, --> 488 orientation, **kwargs) 489 elif ext.find('pdf')>=0: 490 from backend_pdf import FigureCanvasPdf /usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py in print_figure(self, outfile, dpi, facecolor, edgecolor, orientation, papertype) 999 # Let's keep the usetex stuff seperate from the generic postscript 1000 self._print_figure_tex(outfile, dpi, facecolor, edgecolor, -> 1001 orientation, papertype) 1002 else: 1003 if isinstance(outfile, file): /usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py in _print_figure_tex(self, outfile, dpi, facecolor, edgecolor, orientation, papertype) 1233 elif rcParams['text.usetex']: 1234 if False: pass # for debugging -> 1235 else: gs_distill(tmpfile, ext=='.eps', ptype=papertype, bbox=bbox) 1236 1237 if isinstance(outfile, file): /usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py in gs_distill(tmpfile, eps, ptype, bbox) 1331 exit_status = os.system(command) 1332 fh = file(outfile) -> 1333 if exit_status: raise RuntimeError('ghostscript was not able to process \ 1334 your image.\nHere is the full report generated by ghostscript: \ 1335 \n\n'% dvifile + fh.read()) NameError: global name 'dvifile' is not defined </pre> <pre class="moz-signature" cols="72">-- ==================================================================== Eric Emsellem <a class="moz-txt-link-abbreviated" href="mailto:ems...@ob...">ems...@ob...</a> Centre de Recherche Astrophysique de Lyon 9 av. Charles-Andre tel: +33 (0)4 78 86 83 84 69561 Saint-Genis Laval Cedex fax: +33 (0)4 78 86 83 86 France <a class="moz-txt-link-freetext" href="http://www-obs.univ-lyon1.fr/eric.emsellem">http://www-obs.univ-lyon1.fr/eric.emsellem</a> ==================================================================== </pre> </body> </html> |