polar

Hi all,

If I run the attached example I get

python -i test_polar.py --verbose-helpful
$HOME=/home/nwagner
matplotlib data path /usr/lib/python2.4/site-packages/matplotlib/mpl-data
loaded rc file /home/nwagner/matplotlibrc
matplotlib version 0.98.3
verbose.level helpful
interactive is False
units is False
platform is linux2
CONFIGDIR=/home/nwagner/.matplotlib
Using fontManager instance from /home/nwagner/.matplotlib/fontList.cache
backend WXAgg version 2.5.3.1
findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium to Bitstream Vera Sans (/usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf) with score of 1.000000
Found dvipng version 1.5
You are using unicode and latex, but have not enabled the matplotlib 'text.latex.unicode' rcParam.
Traceback (most recent call last):
   File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py", line 1121, in _onPaint
     self.draw(drawDC=drawDC)
   File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wxagg.py", line 60, in draw
     FigureCanvasAgg.draw(self)
   File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 283, in draw
     self.figure.draw(self.renderer)
   File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line 767, in draw
     for a in self.axes: a.draw(renderer)
   File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 1591, in draw
     a.draw(renderer)
   File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line 710, in draw
     tick.draw(renderer)
   File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line 193, in draw
     self.label1.draw(renderer)
   File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line 448, in draw
     bbox, info = self._get_layout(renderer)
   File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line 251, in _get_layout
     w, h, d = renderer.get_text_width_height_descent(
   File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 150, in get_text_width_height_descent
     Z = texmanager.get_grey(s, size, self.dpi)
   File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 383, in get_grey
     pngfile = self.make_png(tex, fontsize, dpi)
   File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 312, in make_png
     dvifile = self.make_dvi(tex, fontsize)
   File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 275, in make_dvi
     texfile = self.make_tex(tex, fontsize)
   File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 254, in make_tex
     fh.write(s)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in position 300: ordinal not in range(128)
You are using unicode and latex, but have not enabled the matplotlib 'text.latex.unicode' rcParam.
Traceback (most recent call last):
   File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py", line 1121, in _onPaint
     self.draw(drawDC=drawDC)
   File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wxagg.py", line 60, in draw
     FigureCanvasAgg.draw(self)
   File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 283, in draw
     self.figure.draw(self.renderer)
   File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line 767, in draw
     for a in self.axes: a.draw(renderer)
   File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 1591, in draw
     a.draw(renderer)
   File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line 710, in draw
     tick.draw(renderer)
   File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line 193, in draw
     self.label1.draw(renderer)
   File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line 448, in draw
     bbox, info = self._get_layout(renderer)
   File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line 251, in _get_layout
     w, h, d = renderer.get_text_width_height_descent(
   File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 150, in get_text_width_height_descent
     Z = texmanager.get_grey(s, size, self.dpi)
   File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 383, in get_grey
     pngfile = self.make_png(tex, fontsize, dpi)
   File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 312, in make_png
     dvifile = self.make_dvi(tex, fontsize)
   File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 275, in make_dvi
     texfile = self.make_tex(tex, fontsize)
   File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 254, in make_tex
     fh.write(s)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in position 300: ordinal not in range(128)

Any idea ?

  Nils

test_polar.py (241 Bytes)

It says:

"You are using unicode and latex, but have not enabled the matplotlib 'text.latex.unicode' rcParam."

Does setting text.latex.unicode to True resolve the issue?

Maybe that message should be made more prominent -- it currently is only displayed when verbose is turned on, but it really is an exception. Maybe that message should be raised, rather than reraising the original one there.

Mike

Nils Wagner wrote:

···

Hi all,

If I run the attached example I get

python -i test_polar.py --verbose-helpful
$HOME=/home/nwagner
matplotlib data path /usr/lib/python2.4/site-packages/matplotlib/mpl-data
loaded rc file /home/nwagner/matplotlibrc
matplotlib version 0.98.3
verbose.level helpful
interactive is False
units is False
platform is linux2
CONFIGDIR=/home/nwagner/.matplotlib
Using fontManager instance from /home/nwagner/.matplotlib/fontList.cache
backend WXAgg version 2.5.3.1
findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium to Bitstream Vera Sans (/usr/lib/python2.4/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf) with score of 1.000000
Found dvipng version 1.5
You are using unicode and latex, but have not enabled the matplotlib 'text.latex.unicode' rcParam.
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py", line 1121, in _onPaint
    self.draw(drawDC=drawDC)
  File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wxagg.py", line 60, in draw
    FigureCanvasAgg.draw(self)
  File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 283, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line 767, in draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 1591, in draw
    a.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line 710, in draw
    tick.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line 193, in draw
    self.label1.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line 448, in draw
    bbox, info = self._get_layout(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line 251, in _get_layout
    w, h, d = renderer.get_text_width_height_descent(
  File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 150, in get_text_width_height_descent
    Z = texmanager.get_grey(s, size, self.dpi)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 383, in get_grey
    pngfile = self.make_png(tex, fontsize, dpi)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 312, in make_png
    dvifile = self.make_dvi(tex, fontsize)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 275, in make_dvi
    texfile = self.make_tex(tex, fontsize)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 254, in make_tex
    fh.write(s)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in position 300: ordinal not in range(128)
You are using unicode and latex, but have not enabled the matplotlib 'text.latex.unicode' rcParam.
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py", line 1121, in _onPaint
    self.draw(drawDC=drawDC)
  File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wxagg.py", line 60, in draw
    FigureCanvasAgg.draw(self)
  File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 283, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line 767, in draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 1591, in draw
    a.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line 710, in draw
    tick.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line 193, in draw
    self.label1.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line 448, in draw
    bbox, info = self._get_layout(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line 251, in _get_layout
    w, h, d = renderer.get_text_width_height_descent(
  File "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 150, in get_text_width_height_descent
    Z = texmanager.get_grey(s, size, self.dpi)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 383, in get_grey
    pngfile = self.make_png(tex, fontsize, dpi)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 312, in make_png
    dvifile = self.make_dvi(tex, fontsize)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 275, in make_dvi
    texfile = self.make_tex(tex, fontsize)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py", line 254, in make_tex
    fh.write(s)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in position 300: ordinal not in range(128)

Any idea ?

Nils
------------------------------------------------------------------------

-------------------------------------------------------------------------
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

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Michael,
I think the issue is that there is no Unicode in the script that was attached - it's just a simple polar call so the user isn't really Unicode".

I think Unicode is starting to creep into the source in various places - we just had a user point out that negative numbers are using a normal negative sign ('-1.2') anymore but some kind of Unicode dash that's a lot bigger than the normal one. I wonder if this could be related...

(If it matters, most of our users would rather have just the regular negative sign and not embedded Unicode in the axis labels - it looks wrong to them and makes doing any kind of processing of axis labels more difficult).

Ted

···

-----Original Message-----
From: Michael Droettboom [mailto:mdroe@…86…]
Sent: Tuesday, November 25, 2008 12:25 PM
To: Nils Wagner
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] polar

It says:

"You are using unicode and latex, but have not enabled the matplotlib
'text.latex.unicode' rcParam."

Does setting text.latex.unicode to True resolve the issue?

Maybe that message should be made more prominent -- it currently is
only
displayed when verbose is turned on, but it really is an exception.
Maybe that message should be raised, rather than reraising the original
one there.

Mike

Nils Wagner wrote:
> Hi all,
>
> If I run the attached example I get
>
> python -i test_polar.py --verbose-helpful
> $HOME=/home/nwagner
> matplotlib data path /usr/lib/python2.4/site-packages/matplotlib/mpl-
data
> loaded rc file /home/nwagner/matplotlibrc
> matplotlib version 0.98.3
> verbose.level helpful
> interactive is False
> units is False
> platform is linux2
> CONFIGDIR=/home/nwagner/.matplotlib
> Using fontManager instance from
/home/nwagner/.matplotlib/fontList.cache
> backend WXAgg version 2.5.3.1
> findfont: Matching
> :family=sans-
serif:style=normal:variant=normal:weight=normal:stretch=normal:size=med
ium
> to Bitstream Vera Sans
> (/usr/lib/python2.4/site-packages/matplotlib/mpl-
data/fonts/ttf/Vera.ttf)
> with score of 1.000000
> Found dvipng version 1.5
> You are using unicode and latex, but have not enabled the matplotlib
> 'text.latex.unicode' rcParam.
> Traceback (most recent call last):
> File
> "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py",
> line 1121, in _onPaint
> self.draw(drawDC=drawDC)
> File
> "/usr/lib/python2.4/site-
packages/matplotlib/backends/backend_wxagg.py",
> line 60, in draw
> FigureCanvasAgg.draw(self)
> File
> "/usr/lib/python2.4/site-
packages/matplotlib/backends/backend_agg.py",
> line 283, in draw
> self.figure.draw(self.renderer)
> File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line
> 767, in draw
> for a in self.axes: a.draw(renderer)
> File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
> 1591, in draw
> a.draw(renderer)
> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
> 710, in draw
> tick.draw(renderer)
> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
> 193, in draw
> self.label1.draw(renderer)
> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
> 448, in draw
> bbox, info = self._get_layout(renderer)
> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
> 251, in _get_layout
> w, h, d = renderer.get_text_width_height_descent(
> File
> "/usr/lib/python2.4/site-
packages/matplotlib/backends/backend_agg.py",
> line 150, in get_text_width_height_descent
> Z = texmanager.get_grey(s, size, self.dpi)
> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> line 383, in get_grey
> pngfile = self.make_png(tex, fontsize, dpi)
> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> line 312, in make_png
> dvifile = self.make_dvi(tex, fontsize)
> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> line 275, in make_dvi
> texfile = self.make_tex(tex, fontsize)
> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> line 254, in make_tex
> fh.write(s)
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
> position 300: ordinal not in range(128)
> You are using unicode and latex, but have not enabled the matplotlib
> 'text.latex.unicode' rcParam.
> Traceback (most recent call last):
> File
> "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py",
> line 1121, in _onPaint
> self.draw(drawDC=drawDC)
> File
> "/usr/lib/python2.4/site-
packages/matplotlib/backends/backend_wxagg.py",
> line 60, in draw
> FigureCanvasAgg.draw(self)
> File
> "/usr/lib/python2.4/site-
packages/matplotlib/backends/backend_agg.py",
> line 283, in draw
> self.figure.draw(self.renderer)
> File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line
> 767, in draw
> for a in self.axes: a.draw(renderer)
> File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
> 1591, in draw
> a.draw(renderer)
> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
> 710, in draw
> tick.draw(renderer)
> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
> 193, in draw
> self.label1.draw(renderer)
> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
> 448, in draw
> bbox, info = self._get_layout(renderer)
> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
> 251, in _get_layout
> w, h, d = renderer.get_text_width_height_descent(
> File
> "/usr/lib/python2.4/site-
packages/matplotlib/backends/backend_agg.py",
> line 150, in get_text_width_height_descent
> Z = texmanager.get_grey(s, size, self.dpi)
> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> line 383, in get_grey
> pngfile = self.make_png(tex, fontsize, dpi)
> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> line 312, in make_png
> dvifile = self.make_dvi(tex, fontsize)
> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> line 275, in make_dvi
> texfile = self.make_tex(tex, fontsize)
> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
> line 254, in make_tex
> fh.write(s)
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
> position 300: ordinal not in range(128)
>
> Any idea ?
>
> Nils
>
> ---------------------------------------------------------------------
---
>
> ---------------------------------------------------------------------
----
> 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

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

-----------------------------------------------------------------------
--
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

No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.175 / Virus Database: 270.9.10/1811 - Release Date:
11/25/2008 8:29 AM

Drain, Theodore R wrote:

Michael,
I think the issue is that there is no Unicode in the script that was attached - it's just a simple polar call so the user isn't really Unicode".
  

Polar plots always use Unicode by default for the degree sign. It would be crazy to try to do those things without Unicode. The problem at hand here is only when usetex is on and text.latex.unicode is False. I think it's perhaps time to adjust the default on the latter to True to avoid this issue -- but someone more familiar with usetex should comment on that.

I think Unicode is starting to creep into the source in various places

Use of Unicode characters in output has existed for some time. There is, however, no Unicode in the source files (something we've had transiently but have addressed), because it does cause a problem with some editors. I think that's a reasonable style guideline, but avoiding Unicode in the output is not. I personally put in a lot of work to support Unicode in all the backends -- it allows the output to be richer and more like traditional typesetting rather than being stuck with the limitations imposed by 7-bit ASCII, which is the only reasonable alternative.

- we just had a user point out that negative numbers are using a normal negative sign ('-1.2') anymore but some kind of Unicode dash that's a lot bigger than the normal one. I wonder if this could be related...
  

Yes, it's another instance of the same thing. (Though if usetex is True, we don't have this specific problem, since TeX has always done this substitution for us and matplotlib doesn't do the hyphen/minus correction.)

(If it matters, most of our users would rather have just the regular negative sign and not embedded Unicode in the axis labels - it looks wrong to them and makes doing any kind of processing of axis labels more difficult).
  

I think that's a matter user preference, and perhaps should be exposed as an rcParam. Personally, it's always bothers me to see TeX-typeset papers where the math expressions have proper minus signs, but the plots use a hyphen. But maybe I'm too bothered by these things... :wink:

As for processing the axis labels, there are far hairier things (such as scientific notation) that make processing axis labels as strings in the general case difficult. If you need their positions as numeric values, one can simply use get_majorticklocs() and get an array of floats.

Cheers,
Mike

···

Ted

-----Original Message-----
From: Michael Droettboom [mailto:mdroe@…86…]
Sent: Tuesday, November 25, 2008 12:25 PM
To: Nils Wagner
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] polar

It says:

"You are using unicode and latex, but have not enabled the matplotlib
'text.latex.unicode' rcParam."

Does setting text.latex.unicode to True resolve the issue?

Maybe that message should be made more prominent -- it currently is
only
displayed when verbose is turned on, but it really is an exception.
Maybe that message should be raised, rather than reraising the original
one there.

Mike

Nils Wagner wrote:
    

Hi all,

If I run the attached example I get

python -i test_polar.py --verbose-helpful
$HOME=/home/nwagner
matplotlib data path /usr/lib/python2.4/site-packages/matplotlib/mpl-
      

data
    

loaded rc file /home/nwagner/matplotlibrc
matplotlib version 0.98.3
verbose.level helpful
interactive is False
units is False
platform is linux2
CONFIGDIR=/home/nwagner/.matplotlib
Using fontManager instance from
      

/home/nwagner/.matplotlib/fontList.cache
    

backend WXAgg version 2.5.3.1
findfont: Matching
:family=sans-
      

serif:style=normal:variant=normal:weight=normal:stretch=normal:size=med
ium
    

to Bitstream Vera Sans
(/usr/lib/python2.4/site-packages/matplotlib/mpl-
      

data/fonts/ttf/Vera.ttf)
    

with score of 1.000000
Found dvipng version 1.5
You are using unicode and latex, but have not enabled the matplotlib
'text.latex.unicode' rcParam.
Traceback (most recent call last):
  File
"/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py",
line 1121, in _onPaint
    self.draw(drawDC=drawDC)
  File
"/usr/lib/python2.4/site-
      

packages/matplotlib/backends/backend_wxagg.py",
    

line 60, in draw
    FigureCanvasAgg.draw(self)
  File
"/usr/lib/python2.4/site-
      

packages/matplotlib/backends/backend_agg.py",
    

line 283, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line
767, in draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
1591, in draw
    a.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
710, in draw
    tick.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
193, in draw
    self.label1.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
448, in draw
    bbox, info = self._get_layout(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
251, in _get_layout
    w, h, d = renderer.get_text_width_height_descent(
  File
"/usr/lib/python2.4/site-
      

packages/matplotlib/backends/backend_agg.py",
    

line 150, in get_text_width_height_descent
    Z = texmanager.get_grey(s, size, self.dpi)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 383, in get_grey
    pngfile = self.make_png(tex, fontsize, dpi)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 312, in make_png
    dvifile = self.make_dvi(tex, fontsize)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 275, in make_dvi
    texfile = self.make_tex(tex, fontsize)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 254, in make_tex
    fh.write(s)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
position 300: ordinal not in range(128)
You are using unicode and latex, but have not enabled the matplotlib
'text.latex.unicode' rcParam.
Traceback (most recent call last):
  File
"/usr/lib/python2.4/site-packages/matplotlib/backends/backend_wx.py",
line 1121, in _onPaint
    self.draw(drawDC=drawDC)
  File
"/usr/lib/python2.4/site-
      

packages/matplotlib/backends/backend_wxagg.py",
    

line 60, in draw
    FigureCanvasAgg.draw(self)
  File
"/usr/lib/python2.4/site-
      

packages/matplotlib/backends/backend_agg.py",
    

line 283, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line
767, in draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
1591, in draw
    a.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
710, in draw
    tick.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
193, in draw
    self.label1.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
448, in draw
    bbox, info = self._get_layout(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
251, in _get_layout
    w, h, d = renderer.get_text_width_height_descent(
  File
"/usr/lib/python2.4/site-
      

packages/matplotlib/backends/backend_agg.py",
    

line 150, in get_text_width_height_descent
    Z = texmanager.get_grey(s, size, self.dpi)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 383, in get_grey
    pngfile = self.make_png(tex, fontsize, dpi)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 312, in make_png
    dvifile = self.make_dvi(tex, fontsize)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 275, in make_dvi
    texfile = self.make_tex(tex, fontsize)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 254, in make_tex
    fh.write(s)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
position 300: ordinal not in range(128)

Any idea ?

Nils

---------------------------------------------------------------------
      

---
    

---------------------------------------------------------------------
      

----
    

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
      

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

-----------------------------------------------------------------------
--
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

No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.175 / Virus Database: 270.9.10/1811 - Release Date:
11/25/2008 8:29 AM
    
-------------------------------------------------------------------------
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
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

This was supposed to be a feature not a bug. As far as I understand,
we are now using the proper minus sign which has the same width as the
horizontal part or a plus sign. See

  http://en.wikipedia.org/wiki/Plus_sign#Plus_sign

in the section "Character codes". The hyphen, which doubles as a
minus sign in the ascii character set, is not the proper character for
typesetting.

I don't think this is the problem Nils is having, because the
character code for the minus sign is different (and in the formatter,
we explicitly convert this if usetex is True) in the
ScalarFormatter.fix_minus method.

If the unicode minus is sufficiently problematic for you, I can add an
rc param. Something like

  axis.unicode_minus : True

The problem here appears to be in
matplotlib.projects.polar.ThetaFormatter.__call__, which uses the
degree symbol. I think all we need to do is return the proper tex
string in this case. Michael, does this look right to you:

        def __call__(self, x, pos=None):
            # \u00b0 : degree symbol
            if rcParams['text.usetex'] and not rcParams['text.latex.unicode']:
                return r"$%d^\circ$" % ((x / npy.pi) * 180.0)
            else:
                return u"%d\u00b0" % ((x / npy.pi) * 180.0)

···

On Tue, Nov 25, 2008 at 2:40 PM, Drain, Theodore R <theodore.r.drain@...369...> wrote:

Michael,
I think the issue is that there is no Unicode in the script that was attached - it's just a simple polar call so the user isn't really Unicode".

I think Unicode is starting to creep into the source in various places - we just had a user point out that negative numbers are using a normal negative sign ('-1.2') anymore but some kind of Unicode dash that's a lot bigger than the normal one. I wonder if this could be related...

(If it matters, most of our users would rather have just the regular negative sign and not embedded Unicode in the axis labels - it looks wrong to them and makes doing any kind of processing of axis labels more difficult).

OK - Thanks for the explanation. Sorry you had to type such a long response to my short little complaint :slight_smile:

···

-----Original Message-----
From: Michael Droettboom [mailto:mdroe@…86…]
Sent: Tuesday, November 25, 2008 1:06 PM
To: Drain, Theodore R
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] polar

Drain, Theodore R wrote:
> Michael,
> I think the issue is that there is no Unicode in the script that was
attached - it's just a simple polar call so the user isn't really
Unicode".
>
Polar plots always use Unicode by default for the degree sign. It
would
be crazy to try to do those things without Unicode. The problem at
hand
here is only when usetex is on and text.latex.unicode is False. I
think
it's perhaps time to adjust the default on the latter to True to avoid
this issue -- but someone more familiar with usetex should comment on
that.
> I think Unicode is starting to creep into the source in various
places
Use of Unicode characters in output has existed for some time. There
is, however, no Unicode in the source files (something we've had
transiently but have addressed), because it does cause a problem with
some editors. I think that's a reasonable style guideline, but
avoiding
Unicode in the output is not. I personally put in a lot of work to
support Unicode in all the backends -- it allows the output to be
richer
and more like traditional typesetting rather than being stuck with the
limitations imposed by 7-bit ASCII, which is the only reasonable
alternative.
> - we just had a user point out that negative numbers are using a
normal negative sign ('-1.2') anymore but some kind of Unicode dash
that's a lot bigger than the normal one. I wonder if this could be
related...
>
Yes, it's another instance of the same thing. (Though if usetex is
True, we don't have this specific problem, since TeX has always done
this substitution for us and matplotlib doesn't do the hyphen/minus
correction.)
> (If it matters, most of our users would rather have just the regular
negative sign and not embedded Unicode in the axis labels - it looks
wrong to them and makes doing any kind of processing of axis labels
more difficult).
>
I think that's a matter user preference, and perhaps should be exposed
as an rcParam. Personally, it's always bothers me to see TeX-typeset
papers where the math expressions have proper minus signs, but the
plots
use a hyphen. But maybe I'm too bothered by these things... :wink:

As for processing the axis labels, there are far hairier things (such
as
scientific notation) that make processing axis labels as strings in the
general case difficult. If you need their positions as numeric values,
one can simply use get_majorticklocs() and get an array of floats.

Cheers,
Mike
> Ted
>
>
>> -----Original Message-----
>> From: Michael Droettboom [mailto:mdroe@…86…]
>> Sent: Tuesday, November 25, 2008 12:25 PM
>> To: Nils Wagner
>> Cc: matplotlib-users@lists.sourceforge.net
>> Subject: Re: [Matplotlib-users] polar
>>
>> It says:
>>
>> "You are using unicode and latex, but have not enabled the
matplotlib
>> 'text.latex.unicode' rcParam."
>>
>> Does setting text.latex.unicode to True resolve the issue?
>>
>> Maybe that message should be made more prominent – it currently is
>> only
>> displayed when verbose is turned on, but it really is an exception.
>> Maybe that message should be raised, rather than reraising the
original
>> one there.
>>
>> Mike
>>
>> Nils Wagner wrote:
>>
>>> Hi all,
>>>
>>> If I run the attached example I get
>>>
>>> python -i test_polar.py --verbose-helpful
>>> $HOME=/home/nwagner
>>> matplotlib data path /usr/lib/python2.4/site-
packages/matplotlib/mpl-
>>>
>> data
>>
>>> loaded rc file /home/nwagner/matplotlibrc
>>> matplotlib version 0.98.3
>>> verbose.level helpful
>>> interactive is False
>>> units is False
>>> platform is linux2
>>> CONFIGDIR=/home/nwagner/.matplotlib
>>> Using fontManager instance from
>>>
>> /home/nwagner/.matplotlib/fontList.cache
>>
>>> backend WXAgg version 2.5.3.1
>>> findfont: Matching
>>> :family=sans-
>>>
>>
serif:style=normal:variant=normal:weight=normal:stretch=normal:size=med
>> ium
>>
>>> to Bitstream Vera Sans
>>> (/usr/lib/python2.4/site-packages/matplotlib/mpl-
>>>
>> data/fonts/ttf/Vera.ttf)
>>
>>> with score of 1.000000
>>> Found dvipng version 1.5
>>> You are using unicode and latex, but have not enabled the
matplotlib
>>> 'text.latex.unicode' rcParam.
>>> Traceback (most recent call last):
>>> File
>>> "/usr/lib/python2.4/site-
packages/matplotlib/backends/backend_wx.py",
>>> line 1121, in _onPaint
>>> self.draw(drawDC=drawDC)
>>> File
>>> "/usr/lib/python2.4/site-
>>>
>> packages/matplotlib/backends/backend_wxagg.py",
>>
>>> line 60, in draw
>>> FigureCanvasAgg.draw(self)
>>> File
>>> "/usr/lib/python2.4/site-
>>>
>> packages/matplotlib/backends/backend_agg.py",
>>
>>> line 283, in draw
>>> self.figure.draw(self.renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/figure.py",
line
>>> 767, in draw
>>> for a in self.axes: a.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
>>> 1591, in draw
>>> a.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
>>> 710, in draw
>>> tick.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
>>> 193, in draw
>>> self.label1.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
>>> 448, in draw
>>> bbox, info = self._get_layout(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
>>> 251, in _get_layout
>>> w, h, d = renderer.get_text_width_height_descent(
>>> File
>>> "/usr/lib/python2.4/site-
>>>
>> packages/matplotlib/backends/backend_agg.py",
>>
>>> line 150, in get_text_width_height_descent
>>> Z = texmanager.get_grey(s, size, self.dpi)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 383, in get_grey
>>> pngfile = self.make_png(tex, fontsize, dpi)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 312, in make_png
>>> dvifile = self.make_dvi(tex, fontsize)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 275, in make_dvi
>>> texfile = self.make_tex(tex, fontsize)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 254, in make_tex
>>> fh.write(s)
>>> UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
>>> position 300: ordinal not in range(128)
>>> You are using unicode and latex, but have not enabled the
matplotlib
>>> 'text.latex.unicode' rcParam.
>>> Traceback (most recent call last):
>>> File
>>> "/usr/lib/python2.4/site-
packages/matplotlib/backends/backend_wx.py",
>>> line 1121, in _onPaint
>>> self.draw(drawDC=drawDC)
>>> File
>>> "/usr/lib/python2.4/site-
>>>
>> packages/matplotlib/backends/backend_wxagg.py",
>>
>>> line 60, in draw
>>> FigureCanvasAgg.draw(self)
>>> File
>>> "/usr/lib/python2.4/site-
>>>
>> packages/matplotlib/backends/backend_agg.py",
>>
>>> line 283, in draw
>>> self.figure.draw(self.renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/figure.py",
line
>>> 767, in draw
>>> for a in self.axes: a.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
>>> 1591, in draw
>>> a.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
>>> 710, in draw
>>> tick.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
>>> 193, in draw
>>> self.label1.draw(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
>>> 448, in draw
>>> bbox, info = self._get_layout(renderer)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
>>> 251, in _get_layout
>>> w, h, d = renderer.get_text_width_height_descent(
>>> File
>>> "/usr/lib/python2.4/site-
>>>
>> packages/matplotlib/backends/backend_agg.py",
>>
>>> line 150, in get_text_width_height_descent
>>> Z = texmanager.get_grey(s, size, self.dpi)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 383, in get_grey
>>> pngfile = self.make_png(tex, fontsize, dpi)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 312, in make_png
>>> dvifile = self.make_dvi(tex, fontsize)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 275, in make_dvi
>>> texfile = self.make_tex(tex, fontsize)
>>> File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
>>> line 254, in make_tex
>>> fh.write(s)
>>> UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
>>> position 300: ordinal not in range(128)
>>>
>>> Any idea ?
>>>
>>> Nils
>>>
>>> -------------------------------------------------------------------

>>>
>> —
>>
>>> -------------------------------------------------------------------

>>>
>> ----
>>
>>> 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
>>>
>> –
>> Michael Droettboom
>> Science Software Branch
>> Operations and Engineering Division
>> Space Telescope Science Institute
>> Operated by AURA for NASA
>>
>>
>> --------------------------------------------------------------------

>> –
>> 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
>>
>> No virus found in this incoming message.
>> Checked by AVG - http://www.avg.com
>> Version: 8.0.175 / Virus Database: 270.9.10/1811 - Release Date:
>> 11/25/2008 8:29 AM
>>
>
> ---------------------------------------------------------------------
----
> 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
>

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.175 / Virus Database: 270.9.10/1811 - Release Date:
11/25/2008 8:29 AM

John Hunter wrote:

The problem here appears to be in
matplotlib.projects.polar.ThetaFormatter.__call__, which uses the
degree symbol. I think all we need to do is return the proper tex
string in this case. Michael, does this look right to you:

        def __call__(self, x, pos=None):
            # \u00b0 : degree symbol
            if rcParams['text.usetex'] and not rcParams['text.latex.unicode']:
                return r"$%d^\circ$" % ((x / npy.pi) * 180.0)
            else:
                return u"%d\u00b0" % ((x / npy.pi) * 180.0)
  

Yeah. Looks good. Though a "usetex" guy should probably comment as to whether "text.latex.unicode == False" is still a good default.

BTW -- the reason I didn't want to use the math syntax in the common case is so that it will work correctly with any arbitrary font (assuming it has a degree sign), whereas $5\circ$ will only work correctly with one of the supported math fonts (Computer Modern and STIX). For usetex, of course, it works fine.

Cheers,
Mike

···

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

No worries. I'm sort of a Unicode/i18n/typesetting geek, I guess... :wink:

Mike

Drain, Theodore R wrote:

···

OK - Thanks for the explanation. Sorry you had to type such a long response to my short little complaint :slight_smile:

-----Original Message-----
From: Michael Droettboom [mailto:mdroe@…86…]
Sent: Tuesday, November 25, 2008 1:06 PM
To: Drain, Theodore R
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] polar

Drain, Theodore R wrote:
    

Michael,
I think the issue is that there is no Unicode in the script that was
      

attached - it's just a simple polar call so the user isn't really
Unicode".
    Polar plots always use Unicode by default for the degree sign. It
would
be crazy to try to do those things without Unicode. The problem at
hand
here is only when usetex is on and text.latex.unicode is False. I
think
it's perhaps time to adjust the default on the latter to True to avoid
this issue -- but someone more familiar with usetex should comment on
that.
    

I think Unicode is starting to creep into the source in various
      

places
Use of Unicode characters in output has existed for some time. There
is, however, no Unicode in the source files (something we've had
transiently but have addressed), because it does cause a problem with
some editors. I think that's a reasonable style guideline, but
avoiding
Unicode in the output is not. I personally put in a lot of work to
support Unicode in all the backends -- it allows the output to be
richer
and more like traditional typesetting rather than being stuck with the
limitations imposed by 7-bit ASCII, which is the only reasonable
alternative.
    

- we just had a user point out that negative numbers are using a
      

normal negative sign ('-1.2') anymore but some kind of Unicode dash
that's a lot bigger than the normal one. I wonder if this could be
related...
    Yes, it's another instance of the same thing. (Though if usetex is
True, we don't have this specific problem, since TeX has always done
this substitution for us and matplotlib doesn't do the hyphen/minus
correction.)
    

(If it matters, most of our users would rather have just the regular
      

negative sign and not embedded Unicode in the axis labels - it looks
wrong to them and makes doing any kind of processing of axis labels
more difficult).
    I think that's a matter user preference, and perhaps should be exposed
as an rcParam. Personally, it's always bothers me to see TeX-typeset
papers where the math expressions have proper minus signs, but the
plots
use a hyphen. But maybe I'm too bothered by these things... :wink:

As for processing the axis labels, there are far hairier things (such
as
scientific notation) that make processing axis labels as strings in the
general case difficult. If you need their positions as numeric values,
one can simply use get_majorticklocs() and get an array of floats.

Cheers,
Mike
    

Ted

-----Original Message-----
From: Michael Droettboom [mailto:mdroe@…86…]
Sent: Tuesday, November 25, 2008 12:25 PM
To: Nils Wagner
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] polar

It says:

"You are using unicode and latex, but have not enabled the
        

matplotlib
    

'text.latex.unicode' rcParam."

Does setting text.latex.unicode to True resolve the issue?

Maybe that message should be made more prominent -- it currently is
only
displayed when verbose is turned on, but it really is an exception.
Maybe that message should be raised, rather than reraising the
        

original
    

one there.

Mike

Nils Wagner wrote:

Hi all,

If I run the attached example I get

python -i test_polar.py --verbose-helpful
$HOME=/home/nwagner
matplotlib data path /usr/lib/python2.4/site-
          

packages/matplotlib/mpl-
    

data

loaded rc file /home/nwagner/matplotlibrc
matplotlib version 0.98.3
verbose.level helpful
interactive is False
units is False
platform is linux2
CONFIGDIR=/home/nwagner/.matplotlib
Using fontManager instance from

/home/nwagner/.matplotlib/fontList.cache

backend WXAgg version 2.5.3.1
findfont: Matching
:family=sans-

serif:style=normal:variant=normal:weight=normal:stretch=normal:size=med
    

ium

to Bitstream Vera Sans
(/usr/lib/python2.4/site-packages/matplotlib/mpl-

data/fonts/ttf/Vera.ttf)

with score of 1.000000
Found dvipng version 1.5
You are using unicode and latex, but have not enabled the
          

matplotlib
    

'text.latex.unicode' rcParam.
Traceback (most recent call last):
  File
"/usr/lib/python2.4/site-
          

packages/matplotlib/backends/backend_wx.py",
    

line 1121, in _onPaint
    self.draw(drawDC=drawDC)
  File
"/usr/lib/python2.4/site-

packages/matplotlib/backends/backend_wxagg.py",

line 60, in draw
    FigureCanvasAgg.draw(self)
  File
"/usr/lib/python2.4/site-

packages/matplotlib/backends/backend_agg.py",

line 283, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/figure.py",
          

line
    

767, in draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
1591, in draw
    a.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
710, in draw
    tick.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
193, in draw
    self.label1.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
448, in draw
    bbox, info = self._get_layout(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
251, in _get_layout
    w, h, d = renderer.get_text_width_height_descent(
  File
"/usr/lib/python2.4/site-

packages/matplotlib/backends/backend_agg.py",

line 150, in get_text_width_height_descent
    Z = texmanager.get_grey(s, size, self.dpi)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 383, in get_grey
    pngfile = self.make_png(tex, fontsize, dpi)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 312, in make_png
    dvifile = self.make_dvi(tex, fontsize)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 275, in make_dvi
    texfile = self.make_tex(tex, fontsize)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 254, in make_tex
    fh.write(s)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
position 300: ordinal not in range(128)
You are using unicode and latex, but have not enabled the
          

matplotlib
    

'text.latex.unicode' rcParam.
Traceback (most recent call last):
  File
"/usr/lib/python2.4/site-
          

packages/matplotlib/backends/backend_wx.py",
    

line 1121, in _onPaint
    self.draw(drawDC=drawDC)
  File
"/usr/lib/python2.4/site-

packages/matplotlib/backends/backend_wxagg.py",

line 60, in draw
    FigureCanvasAgg.draw(self)
  File
"/usr/lib/python2.4/site-

packages/matplotlib/backends/backend_agg.py",

line 283, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/figure.py",
          

line
    

767, in draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
1591, in draw
    a.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
710, in draw
    tick.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/axis.py", line
193, in draw
    self.label1.draw(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
448, in draw
    bbox, info = self._get_layout(renderer)
  File "/usr/lib/python2.4/site-packages/matplotlib/text.py", line
251, in _get_layout
    w, h, d = renderer.get_text_width_height_descent(
  File
"/usr/lib/python2.4/site-

packages/matplotlib/backends/backend_agg.py",

line 150, in get_text_width_height_descent
    Z = texmanager.get_grey(s, size, self.dpi)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 383, in get_grey
    pngfile = self.make_png(tex, fontsize, dpi)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 312, in make_png
    dvifile = self.make_dvi(tex, fontsize)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 275, in make_dvi
    texfile = self.make_tex(tex, fontsize)
  File "/usr/lib/python2.4/site-packages/matplotlib/texmanager.py",
line 254, in make_tex
    fh.write(s)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in
position 300: ordinal not in range(128)

Any idea ?

Nils

-------------------------------------------------------------------
          

--
    

---

-------------------------------------------------------------------
          

--
    

----

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

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

--------------------------------------------------------------------
        

---
    

--
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

No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.175 / Virus Database: 270.9.10/1811 - Release Date:
11/25/2008 8:29 AM

---------------------------------------------------------------------
      

----
    

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

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.175 / Virus Database: 270.9.10/1811 - Release Date:
11/25/2008 8:29 AM
    
-------------------------------------------------------------------------
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
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Added as rc param 'axes.unicode_minus' in svn r6453 with example
examples/api/unicode_minus.py

But I definitely second Michael's suggestion -- you don't want to be
parsing ticklabels if you don't have too!

JDH

···

On Tue, Nov 25, 2008 at 3:16 PM, John Hunter <jdh2358@...287...> wrote:

If the unicode minus is sufficiently problematic for you, I can add an
rc param. Something like

axis.unicode_minus : True