Corrupted percent signs in labels

Hello,

For some reason, my matplotlib isn't able to print percent signs ('%')
properly:

[1] inspiron:~/tmp# cat mplbug.py

import matplotlib
import matplotlib.pyplot as plt
import numpy as np

print matplotlib.__version__
plt.plot(np.arange(10), np.arange(10)**2)
plt.xlabel('Percent [%]')
plt.savefig('mplbug.pdf')

[0] inspiron:~/tmp# python mplbug.py
1.1.1rc2

I have attached the resulting PDF. For some reason, the slash in the
percent sign becomes a triangle that partially covers the upper left
circle.

Known bug? Any workarounds that don't require upgrading (I'd like to
stick with the Debian package)?

Thanks,

   -Nikolaus

mplbug.pdf (9.53 KB)

···

--
»Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C

Hi

2012/10/9 Nikolaus Rath <Nikolaus@…120…3072…>

Hello,

For some reason, my matplotlib isn’t able to print percent signs (‘%’)

properly:

[1] inspiron:~/tmp# cat mplbug.py

import matplotlib

import matplotlib.pyplot as plt

import numpy as np

print matplotlib.version

plt.plot(np.arange(10), np.arange(10)**2)

plt.xlabel(‘Percent [%]’)

plt.savefig(‘mplbug.pdf’)

[0] inspiron:~/tmp# python mplbug.py

1.1.1rc2

I have attached the resulting PDF. For some reason, the slash in the

percent sign becomes a triangle that partially covers the upper left

circle.

Known bug? Any workarounds that don’t require upgrading (I’d like to

stick with the Debian package)?

confirmed for pdf and eps figures. For jpg and png, as well as the matplotlib window with TkAgg the percentage looks fine.

matplotlib version: 1.1.1 shipped with kubuntu 12.10

Francesco

···

Thanks,

-Nikolaus

»Time flies like an arrow, fruit flies like a Banana.«

PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C


Don’t let slow site performance ruin your business. Deploy New Relic APM

Deploy New Relic app performance management and know exactly

what is happening inside your Ruby, Python, PHP, Java, and .NET app

Try New Relic at no cost today and get our sweet Data Nerd shirt too!

http://p.sf.net/sfu/newrelic-dev2dev


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

On Windows it works just fine. Just a wild guess, can you try to make
it a raw string?

plt.xlabel(r'Percent [%]')

···

On Tue, Oct 9, 2012 at 10:45 PM, Francesco Montesano <franz.bergesund@...287...> wrote:

Hi

2012/10/9 Nikolaus Rath <Nikolaus@...3072...>

Hello,

For some reason, my matplotlib isn't able to print percent signs ('%')
properly:

[1] inspiron:~/tmp# cat mplbug.py

import matplotlib
import matplotlib.pyplot as plt
import numpy as np

print matplotlib.__version__
plt.plot(np.arange(10), np.arange(10)**2)
plt.xlabel('Percent [%]')
plt.savefig('mplbug.pdf')

[0] inspiron:~/tmp# python mplbug.py
1.1.1rc2

I have attached the resulting PDF. For some reason, the slash in the
percent sign becomes a triangle that partially covers the upper left
circle.

Known bug? Any workarounds that don't require upgrading (I'd like to
stick with the Debian package)?

confirmed for pdf and eps figures. For jpg and png, as well as the
matplotlib window with TkAgg the percentage looks fine.
matplotlib version: 1.1.1 shipped with kubuntu 12.10

Francesco

Thanks,

   -Nikolaus

--
»Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

I'm using the AGG backend and saving to a png file without any
problems, but I'm using the current git master branch. I'll try to see
if I can recreate on 1.1.1rc2. Watch this space.

···

On Tue, Oct 9, 2012 at 10:32 PM, Nikolaus Rath <Nikolaus@...3072...> wrote:

Hello,

For some reason, my matplotlib isn't able to print percent signs ('%')
properly:

[1] inspiron:~/tmp# cat mplbug.py

import matplotlib
import matplotlib.pyplot as plt
import numpy as np

print matplotlib.__version__
plt.plot(np.arange(10), np.arange(10)**2)
plt.xlabel('Percent [%]')
plt.savefig('mplbug.pdf')

[0] inspiron:~/tmp# python mplbug.py
1.1.1rc2

I have attached the resulting PDF. For some reason, the slash in the
percent sign becomes a triangle that partially covers the upper left
circle.

Known bug? Any workarounds that don't require upgrading (I'd like to
stick with the Debian package)?

Thanks,

   -Nikolaus

--
»Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C

--
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom

No dice. I still can't recreate your problem on OS X 10.7.4 with
matplotlib version 1.1.1-rc2.

What are your font/tex specifications in the matplotlib.rcParams dictionary?

···

On Tue, Oct 9, 2012 at 10:56 PM, Damon McDougall <damon.mcdougall@...287...> wrote:

On Tue, Oct 9, 2012 at 10:32 PM, Nikolaus Rath <Nikolaus@...3072...> wrote:

Hello,

For some reason, my matplotlib isn't able to print percent signs ('%')
properly:

[1] inspiron:~/tmp# cat mplbug.py

import matplotlib
import matplotlib.pyplot as plt
import numpy as np

print matplotlib.__version__
plt.plot(np.arange(10), np.arange(10)**2)
plt.xlabel('Percent [%]')
plt.savefig('mplbug.pdf')

[0] inspiron:~/tmp# python mplbug.py
1.1.1rc2

I have attached the resulting PDF. For some reason, the slash in the
percent sign becomes a triangle that partially covers the upper left
circle.

Known bug? Any workarounds that don't require upgrading (I'd like to
stick with the Debian package)?

Thanks,

   -Nikolaus

--
»Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C

I'm using the AGG backend and saving to a png file without any
problems, but I'm using the current git master branch. I'll try to see
if I can recreate on 1.1.1rc2. Watch this space.

--
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom

It's a known bug, fixed since 1.1.1.

BTW: If you're running the Debian package, how come the version is a release candidate? (1.1.1rc2)

Mike

···

On 10/09/2012 04:32 PM, Nikolaus Rath wrote:

Hello,

For some reason, my matplotlib isn't able to print percent signs ('%')
properly:

[1] inspiron:~/tmp# cat mplbug.py

import matplotlib
import matplotlib.pyplot as plt
import numpy as np

print matplotlib.__version__
plt.plot(np.arange(10), np.arange(10)**2)
plt.xlabel('Percent [%]')
plt.savefig('mplbug.pdf')

[0] inspiron:~/tmp# python mplbug.py
1.1.1rc2

I have attached the resulting PDF. For some reason, the slash in the
percent sign becomes a triangle that partially covers the upper left
circle.

Known bug? Any workarounds that don't require upgrading (I'd like to
stick with the Debian package)?

Thanks,

    -Nikolaus

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Mike,

We didn’t get the final release of v1.1.1 out in time for the Debian Freeze back in the spring. Sandro Toshi could only get the rc2 into the repositories.

Ben Root

···

On Wed, Oct 10, 2012 at 8:23 AM, Michael Droettboom <mdroe@…86…> wrote:

It’s a known bug, fixed since 1.1.1.

  [https://github.com/matplotlib/matplotlib/issues/1211](https://github.com/matplotlib/matplotlib/issues/1211)



  BTW: If you're running the Debian package, how come the version is

a release candidate? (1.1.1rc2)

  Mike