On Feb 15, 2012, at 8:45, Sean Lake wrote: > On Feb 15, 2012, at 0:04, Martin Costabel wrote: > >> On 14/02/12 23:29, Sean Lake wrote: >> [] >>> plt.savefig("asdf.pdf", "pdf") >> >> I think this is a symtax error on your part. If you use >> >> plt.savefig("asdf.pdf", format="pdf") >> >> it will work. >> >> What is strange is that you are running >> python2.7 (at least that's what is written in the first line of your >> script), but your modules are taken from python2.6, as the error message >> >>> File "/sw/lib/python2.6/site-packages/matplotlib/pyplot.py", line 363, in >>> savefig >> >> indicates. This is not the cause of the error, however. >> >> -- >> Martin > > Hello all, > > Excellent! That problem's fixed, now I get the following error. I've tried > moving /usr/local to make sure that my own texlive distribution isn't > interfering. I've also tried removing /usr/bin/env from the front of the > script, and that doesn't help, either. For what it's worth, I also get this > error when trying to run a script that used to work fine. > > Last, there's nothing odd about the original error - I said I see the problem > in both python 2.6 and 2.7. I just copied the wrong one. :) > > Thanks, > Sean > >
Hello again, I've simplified the script and narrowed down the problem area to the attempt to write the results out to pdf or svg. eps works fine, though. The script and error messages follow. Should I be moving this to the matplotlib list? Thanks, Sean #!/usr/bin/env /sw/bin/python2.7 -i import sys #Clear scisoft out from the path search tree i = 0 ssbase = "/usr/local/scisoft" while i < len(sys.path): item = sys.path[i] if ( item != "" and len(item) >= len(ssbase) and item[:len(ssbase)] == ssbase ): del(sys.path[i]) else: i += 1 del item, ssbase, i import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt plt.plot( [ x for x in range(10)], [x for x in range(10)] ) ofmt = "svg" plt.savefig("asdf." + ofmt, format=ofmt) Error for svg: Traceback (most recent call last): File "./blah.py", line 25, in <module> plt.savefig("asdf." + ofmt, format=ofmt) File "/sw/lib/python2.7/site-packages/matplotlib/pyplot.py", line 363, in savefig return fig.savefig(*args, **kwargs) File "/sw/lib/python2.7/site-packages/matplotlib/figure.py", line 1084, in savefig self.canvas.print_figure(*args, **kwargs) File "/sw/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 1923, in print_figure **kwargs) File "/sw/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 1754, in print_svg return svg.print_svg(*args, **kwargs) File "/sw/lib/python2.7/site-packages/matplotlib/backends/backend_svg.py", line 867, in print_svg return self._print_svg(filename, svgwriter, fh_to_close, **kwargs) File "/sw/lib/python2.7/site-packages/matplotlib/backends/backend_svg.py", line 902, in _print_svg self.figure.draw(renderer) File "/sw/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/sw/lib/python2.7/site-packages/matplotlib/figure.py", line 798, in draw func(*args) File "/sw/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/sw/lib/python2.7/site-packages/matplotlib/axes.py", line 1946, in draw a.draw(renderer) File "/sw/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/sw/lib/python2.7/site-packages/matplotlib/axis.py", line 1017, in draw tick.draw(renderer) File "/sw/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/sw/lib/python2.7/site-packages/matplotlib/axis.py", line 234, in draw self.label1.draw(renderer) File "/sw/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/sw/lib/python2.7/site-packages/matplotlib/text.py", line 571, in draw self._fontproperties, angle) File "/sw/lib/python2.7/site-packages/matplotlib/backends/backend_svg.py", line 587, in draw_tex self.draw_text_as_path(gc, x, y, s, prop, angle, ismath="TeX") File "/sw/lib/python2.7/site-packages/matplotlib/backends/backend_svg.py", line 528, in draw_text_as_path _glyphs = text2path.get_glyphs_tex(prop, s, glyph_map=glyph_map) File "/sw/lib/python2.7/site-packages/matplotlib/textpath.py", line 282, in get_glyphs_tex self.tex_font_map = dviread.PsfontsMap(dviread.find_tex_file('pdftex.map')) File "/sw/lib/python2.7/site-packages/matplotlib/dviread.py", line 668, in __init__ self._parse(file) File "/sw/lib/python2.7/site-packages/matplotlib/dviread.py", line 701, in _parse self._register(words) File "/sw/lib/python2.7/site-packages/matplotlib/dviread.py", line 727, in _register assert encoding is None AssertionError ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Fink-users mailing list Fink-users@lists.sourceforge.net List archive: http://news.gmane.org/gmane.os.macosx.fink.user Subscription management: https://lists.sourceforge.net/lists/listinfo/fink-users