can't save in eps

Hi,

I have an error with the SVN version of matplotlib when I'm trying to save a figure in eps format (it's working fine for png, svg). The problem appeared when I'm using savefig("image.eps") or the save icon.
The error message is:

Thanks,

N.

python simple_plot.py
Traceback (most recent call last):
  File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py", line 640, in save_figure
    self.canvas.print_figure(fname)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtkagg.py", line 112, in print_figure
    orientation, **kwargs)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 493, in print_figure
    orientation, **kwargs)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py", line 1141, in print_figure
    self.figure.draw(renderer)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/figure.py", line 529, in draw
    for a in self.axes: a.draw(renderer)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/axes.py", line 1460, in draw
    a.draw(renderer)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/lines.py", line 370, in draw
    lineFunc(renderer, gc, xt, yt)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/lines.py", line 534, in _draw_solid
    renderer.draw_lines(gc, xt, yt, self._transform)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py", line 634, in draw_lines
    codes = where(mask[start:end+1], 'l', 'm')
  File "/usr/local/lib/python2.4/site-packages/numarray/generic.py", line 1068, in where
    return choose(ufunc.not_equal(condition, 0), (y,x), out)
  File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line 1990, in choose
    return _choose(selector, population, outarr, clipmode)
  File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line 1896, in __call__
    computation_mode, woutarr, cfunc, ufargs = \
  File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line 1912, in _setup
    convType = _maxPopType(in2)
  File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line 1854, in _maxPopType
    t = _nc._maxtype(x)
  File "/usr/local/lib/python2.4/site-packages/numarray/numarraycore.py", line 131, in _maxtype
    return PyLevel2Type[_numarray._maxtype(args)]
TypeError: Expecting a python numeric type, got something else.

Please post a brief script that reproduces the problem.

···

On Tuesday 21 March 2006 09:57, Humufr wrote:

Hi,

I have an error with the SVN version of matplotlib when I'm trying to
save a figure in eps format (it's working fine for png, svg). The
problem appeared when I'm using savefig("image.eps") or the save icon.
The error message is:

Thanks,

N.

python simple_plot.py
Traceback (most recent call last):
  File
"/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py"
, line 640, in save_figure
    self.canvas.print_figure(fname)
  File
"/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtkagg.
py", line 112, in print_figure
    orientation, **kwargs)
  File
"/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py"
, line 493, in print_figure
    orientation, **kwargs)
  File
"/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py",
line 1141, in print_figure
    self.figure.draw(renderer)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/figure.py",
line 529, in draw
    for a in self.axes: a.draw(renderer)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/axes.py", line
1460, in draw
    a.draw(renderer)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/lines.py",
line 370, in draw
    lineFunc(renderer, gc, xt, yt)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/lines.py",
line 534, in _draw_solid
    renderer.draw_lines(gc, xt, yt, self._transform)
  File
"/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py",
line 634, in draw_lines
    codes = where(mask[start:end+1], 'l', 'm')
  File "/usr/local/lib/python2.4/site-packages/numarray/generic.py",
line 1068, in where
    return choose(ufunc.not_equal(condition, 0), (y,x), out)
  File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
1990, in choose
    return _choose(selector, population, outarr, clipmode)
  File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
1896, in __call__
    computation_mode, woutarr, cfunc, ufargs = \
  File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
1912, in _setup
    convType = _maxPopType(in2)
  File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
1854, in _maxPopType
    t = _nc._maxtype(x)
  File
"/usr/local/lib/python2.4/site-packages/numarray/numarraycore.py", line
131, in _maxtype
    return PyLevel2Type[_numarray._maxtype(args)]
TypeError: Expecting a python numeric type, got something else.

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live
webcast and join the prime developer group breaking into this new coding
territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

--
Darren S. Dale, Ph.D.
Cornell High Energy Synchrotron Source
Cornell University
200L Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853

dd55@...163...
office: (607) 255-9894
fax: (607) 255-9001

oups I forgot to indicate the svn revision:

revision 2189

N.

Humufr wrote:

···

Hi,

I have an error with the SVN version of matplotlib when I'm trying to save a figure in eps format (it's working fine for png, svg). The problem appeared when I'm using savefig("image.eps") or the save icon.
The error message is:

Thanks,

N.

python simple_plot.py
Traceback (most recent call last):
File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py", line 640, in save_figure
   self.canvas.print_figure(fname)
File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtkagg.py", line 112, in print_figure
   orientation, **kwargs)
File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 493, in print_figure
   orientation, **kwargs)
File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py", line 1141, in print_figure
   self.figure.draw(renderer)
File "/usr/local/lib/python2.4/site-packages/matplotlib/figure.py", line 529, in draw
   for a in self.axes: a.draw(renderer)
File "/usr/local/lib/python2.4/site-packages/matplotlib/axes.py", line 1460, in draw
   a.draw(renderer)
File "/usr/local/lib/python2.4/site-packages/matplotlib/lines.py", line 370, in draw
   lineFunc(renderer, gc, xt, yt)
File "/usr/local/lib/python2.4/site-packages/matplotlib/lines.py", line 534, in _draw_solid
   renderer.draw_lines(gc, xt, yt, self._transform)
File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py", line 634, in draw_lines
   codes = where(mask[start:end+1], 'l', 'm')
File "/usr/local/lib/python2.4/site-packages/numarray/generic.py", line 1068, in where
   return choose(ufunc.not_equal(condition, 0), (y,x), out)
File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line 1990, in choose
   return _choose(selector, population, outarr, clipmode)
File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line 1896, in __call__
   computation_mode, woutarr, cfunc, ufargs = \
File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line 1912, in _setup
   convType = _maxPopType(in2)
File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line 1854, in _maxPopType
   t = _nc._maxtype(x)
File "/usr/local/lib/python2.4/site-packages/numarray/numarraycore.py", line 131, in _maxtype
   return PyLevel2Type[_numarray._maxtype(args)]
TypeError: Expecting a python numeric type, got something else.

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Nevermind, I didnt see the reference to simple plot. This looks like a problem
with the where() function with numarray, it is complaining about creating a
char array. I'm looking into it.

···

On Tuesday 21 March 2006 10:04, Darren Dale wrote:

Please post a brief script that reproduces the problem.

On Tuesday 21 March 2006 09:57, Humufr wrote:
> Hi,
>
> I have an error with the SVN version of matplotlib when I'm trying to
> save a figure in eps format (it's working fine for png, svg). The
> problem appeared when I'm using savefig("image.eps") or the save icon.
> The error message is:
>
> Thanks,
>
> N.
>
>
> python simple_plot.py
> Traceback (most recent call last):
> File
> "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.p
>y" , line 640, in save_figure
> self.canvas.print_figure(fname)
> File
> "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtkag
>g. py", line 112, in print_figure
> orientation, **kwargs)
> File
> "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_agg.p
>y" , line 493, in print_figure
> orientation, **kwargs)
> File
> "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py
>", line 1141, in print_figure
> self.figure.draw(renderer)
> File "/usr/local/lib/python2.4/site-packages/matplotlib/figure.py",
> line 529, in draw
> for a in self.axes: a.draw(renderer)
> File "/usr/local/lib/python2.4/site-packages/matplotlib/axes.py", line
> 1460, in draw
> a.draw(renderer)
> File "/usr/local/lib/python2.4/site-packages/matplotlib/lines.py",
> line 370, in draw
> lineFunc(renderer, gc, xt, yt)
> File "/usr/local/lib/python2.4/site-packages/matplotlib/lines.py",
> line 534, in _draw_solid
> renderer.draw_lines(gc, xt, yt, self._transform)
> File
> "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py
>", line 634, in draw_lines
> codes = where(mask[start:end+1], 'l', 'm')
> File "/usr/local/lib/python2.4/site-packages/numarray/generic.py",
> line 1068, in where
> return choose(ufunc.not_equal(condition, 0), (y,x), out)
> File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
> 1990, in choose
> return _choose(selector, population, outarr, clipmode)
> File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
> 1896, in __call__
> computation_mode, woutarr, cfunc, ufargs = \
> File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
> 1912, in _setup
> convType = _maxPopType(in2)
> File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
> 1854, in _maxPopType
> t = _nc._maxtype(x)
> File
> "/usr/local/lib/python2.4/site-packages/numarray/numarraycore.py", line
> 131, in _maxtype
> return PyLevel2Type[_numarray._maxtype(args)]
> TypeError: Expecting a python numeric type, got something else.
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language that extends applications into web and mobile media. Attend the
> live webcast and join the prime developer group breaking into this new
> coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> matplotlib-users List Signup and Options

--
Darren S. Dale, Ph.D.
Cornell High Energy Synchrotron Source
Cornell University
200L Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853

dd55@...163...
office: (607) 255-9894
fax: (607) 255-9001

Nevermind, I didnt see the reference to simple plot. This looks like a
problem with the where() function with numarray, it is complaining about
creating a char array. I'm looking into it.

Fixed in svn 2190.

I found a non-numerix solution, replacing this:
codes = where(mask[start:end+1], 'l', 'm')
with this:
codes = [('m','l')[i] for i in mask]

···

On Tuesday 21 March 2006 10:11, Darren Dale wrote:

On Tuesday 21 March 2006 10:04, Darren Dale wrote:
> Please post a brief script that reproduces the problem.
>
> On Tuesday 21 March 2006 09:57, Humufr wrote:
> > Hi,
> >
> > I have an error with the SVN version of matplotlib when I'm trying to
> > save a figure in eps format (it's working fine for png, svg). The
> > problem appeared when I'm using savefig("image.eps") or the save icon.
> > The error message is:
> >
> > Thanks,
> >
> > N.
> >
> >
> > python simple_plot.py
> > Traceback (most recent call last):
> > File
> > "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtk
> >.p y" , line 640, in save_figure
> > self.canvas.print_figure(fname)
> > File
> > "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtk
> >ag g. py", line 112, in print_figure
> > orientation, **kwargs)
> > File
> > "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_agg
> >.p y" , line 493, in print_figure
> > orientation, **kwargs)
> > File
> > "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.
> >py ", line 1141, in print_figure
> > self.figure.draw(renderer)
> > File "/usr/local/lib/python2.4/site-packages/matplotlib/figure.py",
> > line 529, in draw
> > for a in self.axes: a.draw(renderer)
> > File "/usr/local/lib/python2.4/site-packages/matplotlib/axes.py",
> > line 1460, in draw
> > a.draw(renderer)
> > File "/usr/local/lib/python2.4/site-packages/matplotlib/lines.py",
> > line 370, in draw
> > lineFunc(renderer, gc, xt, yt)
> > File "/usr/local/lib/python2.4/site-packages/matplotlib/lines.py",
> > line 534, in _draw_solid
> > renderer.draw_lines(gc, xt, yt, self._transform)
> > File
> > "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.
> >py ", line 634, in draw_lines
> > codes = where(mask[start:end+1], 'l', 'm')
> > File "/usr/local/lib/python2.4/site-packages/numarray/generic.py",
> > line 1068, in where
> > return choose(ufunc.not_equal(condition, 0), (y,x), out)
> > File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
> > 1990, in choose
> > return _choose(selector, population, outarr, clipmode)
> > File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
> > 1896, in __call__
> > computation_mode, woutarr, cfunc, ufargs = \
> > File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
> > 1912, in _setup
> > convType = _maxPopType(in2)
> > File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
> > 1854, in _maxPopType
> > t = _nc._maxtype(x)
> > File
> > "/usr/local/lib/python2.4/site-packages/numarray/numarraycore.py", line
> > 131, in _maxtype
> > return PyLevel2Type[_numarray._maxtype(args)]
> > TypeError: Expecting a python numeric type, got something else.
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by xPML, a groundbreaking scripting
> > language that extends applications into web and mobile media. Attend
> > the live webcast and join the prime developer group breaking into this
> > new coding territory!
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=12164
> >2 _______________________________________________
> > Matplotlib-users mailing list
> > Matplotlib-users@lists.sourceforge.net
> > matplotlib-users List Signup and Options

--
Darren S. Dale, Ph.D.
Cornell High Energy Synchrotron Source
Cornell University
200L Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853

dd55@...163...
office: (607) 255-9894
fax: (607) 255-9001

grea, it's working fine now. Thank you very much.

N.

Darren Dale wrote:

···

On Tuesday 21 March 2006 10:11, Darren Dale wrote:
  

Nevermind, I didnt see the reference to simple plot. This looks like a
problem with the where() function with numarray, it is complaining about
creating a char array. I'm looking into it.
    
Fixed in svn 2190.

I found a non-numerix solution, replacing this:
codes = where(mask[start:end+1], 'l', 'm')
with this:
codes = [('m','l')[i] for i in mask]

On Tuesday 21 March 2006 10:04, Darren Dale wrote:
    

Please post a brief script that reproduces the problem.

On Tuesday 21 March 2006 09:57, Humufr wrote:
      

Hi,

I have an error with the SVN version of matplotlib when I'm trying to
save a figure in eps format (it's working fine for png, svg). The
problem appeared when I'm using savefig("image.eps") or the save icon.
The error message is:

Thanks,

N.

python simple_plot.py
Traceback (most recent call last):
  File
"/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtk
.p y" , line 640, in save_figure
    self.canvas.print_figure(fname)
  File
"/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtk
ag g. py", line 112, in print_figure
    orientation, **kwargs)
  File
"/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_agg
.p y" , line 493, in print_figure
    orientation, **kwargs)
  File
"/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.
py ", line 1141, in print_figure
    self.figure.draw(renderer)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/figure.py",
line 529, in draw
    for a in self.axes: a.draw(renderer)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/axes.py",
line 1460, in draw
    a.draw(renderer)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/lines.py",
line 370, in draw
    lineFunc(renderer, gc, xt, yt)
  File "/usr/local/lib/python2.4/site-packages/matplotlib/lines.py",
line 534, in _draw_solid
    renderer.draw_lines(gc, xt, yt, self._transform)
  File
"/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_ps.
py ", line 634, in draw_lines
    codes = where(mask[start:end+1], 'l', 'm')
  File "/usr/local/lib/python2.4/site-packages/numarray/generic.py",
line 1068, in where
    return choose(ufunc.not_equal(condition, 0), (y,x), out)
  File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
1990, in choose
    return _choose(selector, population, outarr, clipmode)
  File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
1896, in __call__
    computation_mode, woutarr, cfunc, ufargs = \
  File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
1912, in _setup
    convType = _maxPopType(in2)
  File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line
1854, in _maxPopType
    t = _nc._maxtype(x)
  File
"/usr/local/lib/python2.4/site-packages/numarray/numarraycore.py", line
131, in _maxtype
    return PyLevel2Type[_numarray._maxtype(args)]
TypeError: Expecting a python numeric type, got something else.

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language that extends applications into web and mobile media. Attend
the live webcast and join the prime developer group breaking into this
new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=12164
2 _______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options