Re: [Matplotlib-users] Error with PDF output with usetex

2011-08-22 Thread Jeff Klukas
On Sun, Aug 21, 2011 at 1:01 PM, Jouni K. Seppänen j...@iki.fi wrote:
 Jeff Klukas klu...@wisc.edu writes:

   File 
 /Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/dviread.py,
 line 727, in _register
     assert encoding is None
 AssertionError

 This sounds like this issue:
 https://github.com/matplotlib/matplotlib/issues/191

 There is a workaround in git commit 708c451 (patch below), which you
 could apply to your local copy of dviread.

It works!  Thanks for a simple fix.

|| Jeff Klukas, Research Assistant
|| Dept. of Physics, Univ. of Wisconsin
|| http://jeff.klukas.net

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Error with PDF output with usetex

2011-08-21 Thread Jouni K . Seppänen
Jeff Klukas klu...@wisc.edu writes:

   File 
 /Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/dviread.py,
 line 727, in _register
 assert encoding is None
 AssertionError

This sounds like this issue:
https://github.com/matplotlib/matplotlib/issues/191

There is a workaround in git commit 708c451 (patch below), which you
could apply to your local copy of dviread.

diff --git a/lib/matplotlib/dviread.py b/lib/matplotlib/dviread.py
index 5843a3c..7aca0ed 100644
--- a/lib/matplotlib/dviread.py
+++ b/lib/matplotlib/dviread.py
@@ -714,22 +714,30 @@ class PsfontsMap(object):
 subsetting, but I have no example of  in my TeX installation.
 
 texname, psname = words[:2]
-effects, encoding, filename = '', None, None
+effects, encodings, filename = '', [], None
 for word in words[2:]:
 if not word.startswith(''):
 effects = word
 else:
 word = word.lstrip('')
 if word.startswith('['):
-assert encoding is None
-encoding = word[1:]
+encodings.append(word[1:])
 elif word.endswith('.enc'):
-assert encoding is None
-encoding = word
+encodings.append(word)
 else:
 assert filename is None
 filename = word
 
+if len(encodings)  1:
+# TODO this is a stopgap workaround, need to handle this correctly
+matplotlib.verbose.report('Multiple encodings for %s = %s, skipping'
+  % (texname, psname), 'debug')
+return
+elif len(encodings) == 1:
+encoding, = encodings
+else:
+encoding = None
+
 eff = effects.split()
 effects = {}
 try:

-- 
Jouni K. Seppänen
http://www.iki.fi/jks
--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Error with PDF output with usetex

2011-08-17 Thread Jeff Klukas
On Tue, Aug 16, 2011 at 4:22 AM, Damon McDougall
d.mcdoug...@warwick.ac.uk wrote:
 Hi Jeff,

 I am able to run the tex_demo.py with no problems and I can create

 output files using the Agg backend.  When I try to use the PDF

 backend, however, I get an error which stems from dviread.py (pasted

 below).  Any thoughts on what could be going wrong?

 Thanks!

 Jeff

 Hi Jeff,

 How did you install matplotlib? From source yourself?

 No, I'm using the Enthought Python Distribution (EPD64).

 And when you installed matplotlib, did it see that you had dvipng installed?

 FYI, you can do

 which dvipng

 to return the path where dvipng lives (if it is in your path already) or you

 can do

 locate dvipng

 to do a search for the binary if it isn't already in your path.

 P.S. You forgot to reply-all so everyone can see your response.

 $ which dvipng
 /usr/texbin/dvipng

 I don't remember any complaints while running the EPD installer.
 Would there be a way to check this?  Is the problem definitely related
 to an inability to find dvipng, or could there be other possibilities?

 Thanks,
 Jeff

 I had a similar problem. I don't think it's an inability to find dvipng, I
 think it's that it couldn't find dvipng when matplotlib was built.
 When matplotlib builds there'll be a section of text sent to stdout under
 the heading of 'OPTIONAL DEPENDENCIES', there it will tell you whether it
 found dvipng when it was building. Are you able to find this? If not, are
 there install logs saved somewhere after you installed matplotlib?

I'm not able to find this.  The EPD installer comes as a Mac .pkg
application which seems to hide everything that's going on.  It saves
Receipts, but these don't contain the kind of logs we're looking
for, as far as I can tell.

On my previous laptop, I was using OS X Snow Leopard with python and
matplotlib from an older EPD version, and I had no troubles.  Perhaps
I need to ask the Enthought folks.

Thanks,
Jeff

--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Error with PDF output with usetex

2011-08-17 Thread Damon McDougall
 Hi Jeff,
 
 I am able to run the tex_demo.py with no problems and I can create
 
 output files using the Agg backend.  When I try to use the PDF
 
 backend, however, I get an error which stems from dviread.py (pasted
 
 below).  Any thoughts on what could be going wrong?
 
 Thanks!
 
 Jeff
 
 Hi Jeff,
 
 How did you install matplotlib? From source yourself?
 
 No, I'm using the Enthought Python Distribution (EPD64).
 
 And when you installed matplotlib, did it see that you had dvipng installed?
 
 FYI, you can do
 
 which dvipng
 
 to return the path where dvipng lives (if it is in your path already) or you
 
 can do
 
 locate dvipng
 
 to do a search for the binary if it isn't already in your path.
 
 P.S. You forgot to reply-all so everyone can see your response.
 
 $ which dvipng
 /usr/texbin/dvipng
 
 I don't remember any complaints while running the EPD installer.
 Would there be a way to check this?  Is the problem definitely related
 to an inability to find dvipng, or could there be other possibilities?
 
 Thanks,
 Jeff
 
 I had a similar problem. I don't think it's an inability to find dvipng, I
 think it's that it couldn't find dvipng when matplotlib was built.
 When matplotlib builds there'll be a section of text sent to stdout under
 the heading of 'OPTIONAL DEPENDENCIES', there it will tell you whether it
 found dvipng when it was building. Are you able to find this? If not, are
 there install logs saved somewhere after you installed matplotlib?
 
 I'm not able to find this.  The EPD installer comes as a Mac .pkg
 application which seems to hide everything that's going on.  It saves
 Receipts, but these don't contain the kind of logs we're looking
 for, as far as I can tell.
 
 On my previous laptop, I was using OS X Snow Leopard with python and
 matplotlib from an older EPD version, and I had no troubles.  Perhaps
 I need to ask the Enthought folks.
 
 Thanks,
 Jeff

Hmm.

You could try installing from source as per 
http://matplotlib.sourceforge.net/faq/installing_faq.html#building-and-installing-from-source-on-osx-with-epd
 and at least that way you can see what's going on.

Damon McDougall
d.mcdoug...@warwick.ac.uk
http://damon.is-a-geek.com
B2.39
Mathematics Institute
Coventry
West Midlands
CV4 7AL


--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Error with PDF output with usetex

2011-08-16 Thread Damon McDougall
 Hi Jeff,
 
 I am able to run the tex_demo.py with no problems and I can create
 
 output files using the Agg backend.  When I try to use the PDF
 
 backend, however, I get an error which stems from dviread.py (pasted
 
 below).  Any thoughts on what could be going wrong?
 
 Thanks!
 
 Jeff
 
 Hi Jeff,
 
 How did you install matplotlib? From source yourself?
 
 No, I'm using the Enthought Python Distribution (EPD64).
 
 And when you installed matplotlib, did it see that you had dvipng installed?
 FYI, you can do
 which dvipng
 to return the path where dvipng lives (if it is in your path already) or you
 can do
 locate dvipng
 to do a search for the binary if it isn't already in your path.
 P.S. You forgot to reply-all so everyone can see your response.
 
 $ which dvipng
 /usr/texbin/dvipng
 
 I don't remember any complaints while running the EPD installer.
 Would there be a way to check this?  Is the problem definitely related
 to an inability to find dvipng, or could there be other possibilities?
 
 Thanks,
 Jeff

I had a similar problem. I don't think it's an inability to find dvipng, I 
think it's that it couldn't find dvipng when matplotlib was built.

When matplotlib builds there'll be a section of text sent to stdout under the 
heading of 'OPTIONAL DEPENDENCIES', there it will tell you whether it found 
dvipng when it was building. Are you able to find this? If not, are there 
install logs saved somewhere after you installed matplotlib?

Damon McDougall
d.mcdoug...@warwick.ac.uk
http://damon.is-a-geek.com
B2.39
Mathematics Institute
Coventry
West Midlands
CV4 7AL


--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Error with PDF output with usetex

2011-08-15 Thread Jeff Klukas
Hello all,

I am running Mac OS X 10.7 Lion with matplotlib 1.0.1 and the MacTex
2011 distrubution.

I am able to run the tex_demo.py with no problems and I can create
output files using the Agg backend.  When I try to use the PDF
backend, however, I get an error which stems from dviread.py (pasted
below).  Any thoughts on what could be going wrong?

Thanks!
Jeff

|| Jeff Klukas
|| Research Assistant (Physics), University of Wisconsin
|| jeff.klukas@gmail | jeffyklukas@aim | jeffklukas@skype
|| http://hep.wisc.edu/~jklukas/



Traceback (most recent call last):
  File tex_demo.py, line 32, in module
savefig('tex_demo')
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/pyplot.py,
line 363, in savefig
return fig.savefig(*args, **kwargs)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/figure.py,
line 1084, in savefig
self.canvas.print_figure(*args, **kwargs)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/backend_bases.py,
line 1923, in print_figure
**kwargs)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py,
line 2156, in print_pdf
self.figure.draw(renderer)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/artist.py,
line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/figure.py,
line 798, in draw
func(*args)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/artist.py,
line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/axes.py,
line 1946, in draw
a.draw(renderer)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/artist.py,
line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/axis.py,
line 1017, in draw
tick.draw(renderer)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/artist.py,
line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/axis.py,
line 234, in draw
self.label1.draw(renderer)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/artist.py,
line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/text.py,
line 571, in draw
self._fontproperties, angle)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py,
line 1549, in draw_tex
psfont = self.tex_font_mapping(dvifont.texname)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/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 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/dviread.py,
line 668, in __init__
self._parse(file)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/dviread.py,
line 701, in _parse
self._register(words)
  File 
/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/dviread.py,
line 727, in _register
assert encoding is None
AssertionError

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Error with PDF output with usetex

2011-08-15 Thread Damon McDougall
 Hi Jeff,
 
 I am able to run the tex_demo.py with no problems and I can create
 output files using the Agg backend.  When I try to use the PDF
 backend, however, I get an error which stems from dviread.py (pasted
 below).  Any thoughts on what could be going wrong?
 
 Thanks!
 Jeff
 
 Hi Jeff,
 How did you install matplotlib? From source yourself?
 
 No, I'm using the Enthought Python Distribution (EPD64).

And when you installed matplotlib, did it see that you had dvipng installed?

FYI, you can do

which dvipng

to return the path where dvipng lives (if it is in your path already) or you 
can do

locate dvipng

to do a search for the binary if it isn't already in your path.

P.S. You forgot to reply-all so everyone can see your response.

Damon McDougall
d.mcdoug...@warwick.ac.uk
http://damon.is-a-geek.com
B2.39
Mathematics Institute
Coventry
West Midlands
CV4 7AL


--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Error with PDF output with usetex

2011-08-15 Thread Jeff Klukas
On Mon, Aug 15, 2011 at 10:00 PM, Damon McDougall
d.mcdoug...@warwick.ac.uk wrote:
 Hi Jeff,

 I am able to run the tex_demo.py with no problems and I can create

 output files using the Agg backend.  When I try to use the PDF

 backend, however, I get an error which stems from dviread.py (pasted

 below).  Any thoughts on what could be going wrong?

 Thanks!

 Jeff

 Hi Jeff,

 How did you install matplotlib? From source yourself?

 No, I'm using the Enthought Python Distribution (EPD64).

 And when you installed matplotlib, did it see that you had dvipng installed?
 FYI, you can do
 which dvipng
 to return the path where dvipng lives (if it is in your path already) or you
 can do
 locate dvipng
 to do a search for the binary if it isn't already in your path.
 P.S. You forgot to reply-all so everyone can see your response.

$ which dvipng
/usr/texbin/dvipng

I don't remember any complaints while running the EPD installer.
Would there be a way to check this?  Is the problem definitely related
to an inability to find dvipng, or could there be other possibilities?

Thanks,
Jeff

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users