Re: [Fink-users] Problem Plotting using Matplotlib-py26 and py27
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
Re: [Fink-users] Problem Plotting using Matplotlib-py26 and py27
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 -- 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
Re: [Fink-users] Problem Plotting using Matplotlib-py26 and py27
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 Traceback (most recent call last): File ./blah.py, line 34, in module plt.savefig(asdf.pdf, format=pdf) 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 1733, in print_pdf return pdf.print_pdf(*args, **kwargs) File /sw/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py, line 2156, in print_pdf 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_pdf.py, line 1549, in draw_tex psfont = self.tex_font_mapping(dvifont.texname) File /sw/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py, line 1365, in tex_font_mapping 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
Re: [Fink-users] Problem Plotting using Matplotlib-py26 and py27
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2/14/12 5:29 PM, Sean Lake wrote: Hello all, I'm experiencing trouble with Matplotlib. Here is a short script that reproduces the error followed by the error. matplotlib-py27-1.0.1-1 matplotlib-py26-1.0.1-1 python26-2.6.7-3 python27-2.7.2-5 fink --version Package manager version: 0.32.2 Distribution version: selfupdate-rsync Tue Feb 14 14:23:59 2012, 10.6, x86_64 Trees: local/main stable/main stable/crypto unstable/main unstable/crypto #!/usr/bin/env /sw/bin/python2.7 -i ofmt = pdf 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 from numpy import * import scipy as sp import matplotlib #matplotlib.use(GTKAgg) matplotlib.use(Agg) import matplotlib.axes as mpax import matplotlib.ticker as pltck import matplotlib.figure as pltfig import matplotlib.pyplot as plt plt.close(all) plt.figure( 1 ) plt.plot( [ x for x in range(10)], [x for x in range(10)] ) plt.savefig(asdf.pdf, pdf) Error: Traceback (most recent call last): File stdin, line 1, in module File /sw/lib/python2.6/site-packages/matplotlib/pyplot.py, line 363, in savefig return fig.savefig(*args, **kwargs) File /sw/lib/python2.6/site-packages/matplotlib/figure.py, line 1084, in savefig self.canvas.print_figure(*args, **kwargs) TypeError: print_figure() got multiple values for keyword argument 'dpi' I can reproduce the failure using Sean's script. - -- Alexander Hansen, Ph.D. Fink User Liaison http://finkakh.wordpress.com/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk86938ACgkQB8UpO3rKjQ/mnQCePh03Hir66wu4R5X87/rE3bNL lV0An2hpDZoWzZp8X/sZ6W7xEEAQPqlc =iA22 -END PGP SIGNATURE- -- 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