|
From: Nikolaus R. <Nik...@ra...> - 2012-10-09 20:32:25
Attachments:
mplbug.pdf
|
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
|
|
From: Francesco M. <fra...@gm...> - 2012-10-09 20:46:25
|
Hi
2012/10/9 Nikolaus Rath <Nik...@ra...>
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
|
|
From: Daπid <dav...@gm...> - 2012-10-09 20:52:08
|
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
<fra...@gm...> wrote:
> Hi
>
> 2012/10/9 Nikolaus Rath <Nik...@ra...>
>>
>> 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
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Damon M. <dam...@gm...> - 2012-10-09 20:56:36
|
On Tue, Oct 9, 2012 at 10:32 PM, Nikolaus Rath <Nik...@ra...> 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
|
|
From: Damon M. <dam...@gm...> - 2012-10-09 21:02:04
|
On Tue, Oct 9, 2012 at 10:56 PM, Damon McDougall
<dam...@gm...> wrote:
> On Tue, Oct 9, 2012 at 10:32 PM, Nikolaus Rath <Nik...@ra...> 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.
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?
--
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
|
|
From: Nikolaus R. <Nik...@ra...> - 2012-10-09 22:41:41
|
Damon McDougall <dam...@pu...> writes:
> On Tue, Oct 9, 2012 at 10:56 PM, Damon McDougall
> <dam...@pu...> wrote:
>> On Tue, Oct 9, 2012 at 10:32 PM, Nikolaus Rath <Nik...@pu...> 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)?
>>
>> 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.
>
> 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?
For me the problem occurs with PDF files, not PNG files. Or was that
just a typo?
Font specifications are all default.
# python -c 'import matplotlib; import pprint;
# pprint.pprint(matplotlib.rcParams)' | egrep 'tex'
'legend.handletextpad': 0.8,
'mathtext.bf': 'serif:bold',
'mathtext.cal': 'cursive',
'mathtext.default': 'it',
'mathtext.fallback_to_cm': True,
'mathtext.fontset': 'cm',
'mathtext.it': 'serif:italic',
'mathtext.rm': 'serif',
'mathtext.sf': 'sans\\-serif',
'mathtext.tt': 'monospace',
'text.antialiased': True,
'text.color': 'k',
'text.dvipnghack': None,
'text.hinting': True,
'text.latex.preamble': [''],
'text.latex.preview': False,
'text.latex.unicode': False,
'text.usetex': False,
Best,
-Nikolaus
--
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
|
|
From: Benjamin R. <ben...@ou...> - 2012-10-10 02:32:07
|
On Tuesday, October 9, 2012, Nikolaus Rath wrote:
> Damon McDougall <dam...@pu...<javascript:;>>
> writes:
> > On Tue, Oct 9, 2012 at 10:56 PM, Damon McDougall
> > <dam...@pu... <javascript:;>>
> wrote:
> >> On Tue, Oct 9, 2012 at 10:32 PM, Nikolaus Rath <
> Nik...@pu... <javascript:;>> 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)?
> >>
> >> 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.
> >
> > 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?
>
> For me the problem occurs with PDF files, not PNG files. Or was that
> just a typo?
>
> Font specifications are all default.
>
> # python -c 'import matplotlib; import pprint;
> # pprint.pprint(matplotlib.rcParams)' | egrep 'tex'
> 'legend.handletextpad': 0.8,
> 'mathtext.bf': 'serif:bold',
> 'mathtext.cal': 'cursive',
> 'mathtext.default': 'it',
> 'mathtext.fallback_to_cm': True,
> 'mathtext.fontset': 'cm',
> 'mathtext.it': 'serif:italic',
> 'mathtext.rm': 'serif',
> 'mathtext.sf': 'sans\\-serif',
> 'mathtext.tt': 'monospace',
> 'text.antialiased': True,
> 'text.color': 'k',
> 'text.dvipnghack': None,
> 'text.hinting': True,
> 'text.latex.preamble': [''],
> 'text.latex.preview': False,
> 'text.latex.unicode': False,
> 'text.usetex': False,
>
> Best,
>
> -Nikolaus
>
>
I think I know why this is happening. Iirc, we recently took on a patch to
allow string formatting for labels. For most cases, it shouldn't effect
anybody, but if there is a lonely percent sign, I would imagine it could
cause issues. As a test, try a double percent sign '%%'. If that works,
the my theory might be right.
In addition, I think it is only in master, not v1.2.x.
Ben Root
|
|
From: Nikolaus R. <Nik...@ra...> - 2012-10-10 13:39:52
|
Benjamin Root <ben...@pu...> writes:
>> >>> 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)?
>> >>
>> >> 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.
>> >
>> > 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?
>>
>> For me the problem occurs with PDF files, not PNG files. Or was that
>> just a typo?
>>
>> Font specifications are all default.
>>
>> # python -c 'import matplotlib; import pprint;
>> # pprint.pprint(matplotlib.rcParams)' | egrep 'tex'
>> 'legend.handletextpad': 0.8,
>> 'mathtext.bf': 'serif:bold',
>> 'mathtext.cal': 'cursive',
>> 'mathtext.default': 'it',
>> 'mathtext.fallback_to_cm': True,
>> 'mathtext.fontset': 'cm',
>> 'mathtext.it': 'serif:italic',
>> 'mathtext.rm': 'serif',
>> 'mathtext.sf': 'sans\\-serif',
>> 'mathtext.tt': 'monospace',
>> 'text.antialiased': True,
>> 'text.color': 'k',
>> 'text.dvipnghack': None,
>> 'text.hinting': True,
>> 'text.latex.preamble': [''],
>> 'text.latex.preview': False,
>> 'text.latex.unicode': False,
>> 'text.usetex': False,
>>
> I think I know why this is happening. Iirc, we recently took on a patch to
> allow string formatting for labels. For most cases, it shouldn't effect
> anybody, but if there is a lonely percent sign, I would imagine it could
> cause issues. As a test, try a double percent sign '%%'. If that works,
> the my theory might be right.
Nope, using '%%' just results in two corrupted signs in the PDF.
Best,
-Nikolaus
--
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
|
|
From: Michael D. <md...@st...> - 2012-10-10 12:23:33
|
It's a known bug, fixed since 1.1.1. 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 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Benjamin R. <ben...@ou...> - 2012-10-10 12:54:00
|
On Wed, Oct 10, 2012 at 8:23 AM, Michael Droettboom <md...@st...> wrote: > It's a known bug, fixed since 1.1.1. > > 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 > > 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 |
|
From: Nikolaus R. <Nik...@ra...> - 2012-10-10 13:45:54
|
Michael Droettboom <mdr...@pu...> writes:
>> For some reason, my matplotlib isn't able to print percent signs ('%')
>> properly:
>
> It's a known bug, fixed since 1.1.1.
>
> https://github.com/matplotlib/matplotlib/issues/1211
Indeed. Luckily 1.2.0~rc2-1 is in experimental, and upgrading fixed the
problem. Thanks!
Now the only question that remains is: why doesn't github find this
issue when I search for '%'?
> BTW: If you're running the Debian package, how come the version is a
> release candidate? (1.1.1rc2)
Not sure what you mean, why shouldn't it?
Best,
-Nikolaus
--
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
|
|
From: Michael D. <md...@st...> - 2012-10-10 13:50:10
|
On 10/10/2012 09:45 AM, Nikolaus Rath wrote:
> Michael Droettboom <mdr...@pu...> writes:
>>> For some reason, my matplotlib isn't able to print percent signs ('%')
>>> properly:
>> It's a known bug, fixed since 1.1.1.
>>
>> https://github.com/matplotlib/matplotlib/issues/1211
> Indeed. Luckily 1.2.0~rc2-1 is in experimental, and upgrading fixed the
> problem. Thanks!
>
> Now the only question that remains is: why doesn't github find this
> issue when I search for '%'?
Indeed - we should file a bug with github. I was able to find it
because I knew the bug had to do with ttconv -- but there's no reason a
user should have to know that.
>
>> BTW: If you're running the Debian package, how come the version is a
>> release candidate? (1.1.1rc2)
> Not sure what you mean, why shouldn't it?
>
I had just forgotten that Debian went with a release candidate --
ideally it would have been a final release, but the schedule didn't work
out that way.
Mike
|