On Fri, Nov 21, 2008 at 10:37 AM, Eric Bruning <[EMAIL PROTECTED]> wrote:
>> Can you post a complete, free-standing example script which replicates
>> the problem
>
> import matplotlib.pyplot as plt
> f=plt.figure()
> ax=f.add_subplot(111)
> ax.plot(range(10))
> ax.text(-10, 5, 'this one is ok')
> ax.text(-1202255993.82, 5, 'this one fails')
> plt.show()
>
>> and also the output of the script run with --verbose-debug?
> See attached.

OK, thanks.  I can replicate this on one machine (on which python is
compiled for 32bit)

  [EMAIL PROTECTED]:~> uname -a
  SunOS flag 5.10 Generic_118855-15 i86pc i386 i86pc
  [EMAIL PROTECTED]:~> python -V
  Python 2.4.5
  [EMAIL PROTECTED]:~> gcc --version
  gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
  [EMAIL PROTECTED]:~> python -c 'import sys; print sys.maxint'
  2147483647


but not on another (on which python supports 64 bit)

  [EMAIL PROTECTED]:unit> uname -a
  Linux bic128.bic.berkeley.edu 2.6.26.6-49.fc8 #1 SMP Fri Oct 17
15:33:32 EDT 2008 x86_64   x86_64 x86_64 GNU/Linux
  [EMAIL PROTECTED]:unit> python -V
  Python 2.5.1
  [EMAIL PROTECTED]:unit> gcc --version
  gcc (GCC) 4.1.2 20070925 (Red Hat 4.1.2-33)\
  [EMAIL PROTECTED]:unit> python -c 'import sys; print sys.maxint'
  9223372036854775807


My guess is the transformation is putting this int out of bounds on
the 32 bit system triggering an exception in the cxx code.

>From the exception, it looks like the exception is being set in cxx
extension code but is not being raised at the time the exception is
set, because there is no reason the iteration over the info should be
triggering the exception at that time.  I fixed backend agg to raise
the proper exception so it is at least less confusing -- it now raises

[EMAIL PROTECTED]:~> python test.py
Traceback (most recent call last):
  File "test.py", line 9, in ?
    fig.canvas.draw()
  File 
"/home/titan/johnh/dev/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py",
line 283, in draw
    self.figure.draw(self.renderer)
  File "/home/titan/johnh/dev/lib/python2.4/site-packages/matplotlib/figure.py",
line 767, in draw
    for a in self.axes: a.draw(renderer)
  File "/home/titan/johnh/dev/lib/python2.4/site-packages/matplotlib/axes.py",
line 1590, in draw
    a.draw(renderer)
  File "/home/titan/johnh/dev/lib/python2.4/site-packages/matplotlib/text.py",
line 496, in draw
    ismath=self.is_math_text(line))
  File 
"/home/titan/johnh/dev/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py",
line 135, in draw_text
    self._renderer.draw_text_image(font.get_image(), int(x), int(y) +
1, angle, gc)
TypeError: Invalid input arguments to draw_text_image



I'm not sure what the desired behavior here is.  We could make it fail
silently (not plot the text rather than raise)....

JDH

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to