leading whitespace in text

Hello,

consider the following simple code:

import matplotlib
from matplotlib import pyplot
pyplot.text(0, 0, " <--", family='monospace')
pyplot.show()

Using matplotlib-0.99.3.win32-py2.6, the text '<--' is drawn with an x-offset from the y-axis, as expected from the presence of leading whitespace.

Using matplotlib-1.0.svn.win32-py2.6 rev 8347, the leading whitespace is apparently removed from the text and '<--' is drawn right at the y-axis with no x-offset.

In both cases the font is monospace.

Is this change intended or a regression in 1.0svn?

Thank you.

···

--
Christoph

Christoph,

I haven't had a chance to try this out with my machine that has MPL 1.0svn on it, but is there any chance that you have mpl.rcParams['text.usetex'] = True when you get the error?

-paul

···

-----Original Message-----
From: Christoph Gohlke [mailto:cgohlke@…2143…]
Sent: Sunday, May 30, 2010 3:41 PM
To: matplotlib-users@lists.sourceforge.net
Subject: [Matplotlib-users] leading whitespace in text

Hello,

consider the following simple code:

import matplotlib
from matplotlib import pyplot
pyplot.text(0, 0, " <--", family='monospace')
pyplot.show()

Using matplotlib-0.99.3.win32-py2.6, the text '<--' is drawn with an
x-offset from the y-axis, as expected from the presence of leading
whitespace.

Using matplotlib-1.0.svn.win32-py2.6 rev 8347, the leading whitespace is
apparently removed from the text and '<--' is drawn right at the y-axis
with no x-offset.

In both cases the font is monospace.

Is this change intended or a regression in 1.0svn?

Hi Paul,

no, usetex is not set, I made sure of that. I have traced this to a recent commit and opened a ticket on SF.

<http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/src/ft2font.cpp?r1=7635&r2=7838>
<http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/src/ft2font.cpp?r1=7838&r2=7839>

<http://sourceforge.net/tracker/?func=detail&aid=3010045&group_id=80706&atid=560720>

···

On 6/3/2010 5:20 PM, PHobson@...2792... wrote:

-----Original Message-----
From: Christoph Gohlke [mailto:cgohlke@…2143…]
Sent: Sunday, May 30, 2010 3:41 PM
To: matplotlib-users@lists.sourceforge.net
Subject: [Matplotlib-users] leading whitespace in text

Hello,

consider the following simple code:

import matplotlib
from matplotlib import pyplot
pyplot.text(0, 0, "<--", family='monospace')
pyplot.show()

Using matplotlib-0.99.3.win32-py2.6, the text '<--' is drawn with an
x-offset from the y-axis, as expected from the presence of leading
whitespace.

Using matplotlib-1.0.svn.win32-py2.6 rev 8347, the leading whitespace is
apparently removed from the text and '<--' is drawn right at the y-axis
with no x-offset.

In both cases the font is monospace.

Is this change intended or a regression in 1.0svn?

Christoph,

I haven't had a chance to try this out with my machine that has MPL 1.0svn on it, but is there any chance that you have mpl.rcParams['text.usetex'] = True when you get the error?

--
Christoph

Thanks for doing that. I have assigned it to Mike D. I hope he has a little time to look at it. I suspect he will instantly see what the problem is and how to fix it.

Eric

···

On 06/03/2010 02:29 PM, Christoph Gohlke wrote:

On 6/3/2010 5:20 PM, PHobson@...2792... wrote:

-----Original Message-----
From: Christoph Gohlke [mailto:cgohlke@…2143…]
Sent: Sunday, May 30, 2010 3:41 PM
To: matplotlib-users@lists.sourceforge.net
Subject: [Matplotlib-users] leading whitespace in text

Hello,

consider the following simple code:

import matplotlib
from matplotlib import pyplot
pyplot.text(0, 0, "<--", family='monospace')
pyplot.show()

Using matplotlib-0.99.3.win32-py2.6, the text '<--' is drawn with an
x-offset from the y-axis, as expected from the presence of leading
whitespace.

Using matplotlib-1.0.svn.win32-py2.6 rev 8347, the leading whitespace is
apparently removed from the text and '<--' is drawn right at the y-axis
with no x-offset.

In both cases the font is monospace.

Is this change intended or a regression in 1.0svn?

Christoph,

I haven't had a chance to try this out with my machine that has MPL 1.0svn on it, but is there any chance that you have mpl.rcParams['text.usetex'] = True when you get the error?

Hi Paul,

no, usetex is not set, I made sure of that. I have traced this to a
recent commit and opened a ticket on SF.

<http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/src/ft2font.cpp?r1=7635&r2=7838>
<http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/src/ft2font.cpp?r1=7838&r2=7839>

<http://sourceforge.net/tracker/?func=detail&aid=3010045&group_id=80706&atid=560720>

Fixed in r8373.

Mike

···

On 06/03/2010 09:01 PM, Eric Firing wrote:

On 06/03/2010 02:29 PM, Christoph Gohlke wrote:
   

On 6/3/2010 5:20 PM, PHobson@...2792... wrote:
     

-----Original Message-----
From: Christoph Gohlke [mailto:cgohlke@…2143…]
Sent: Sunday, May 30, 2010 3:41 PM
To: matplotlib-users@lists.sourceforge.net
Subject: [Matplotlib-users] leading whitespace in text

Hello,

consider the following simple code:

import matplotlib
from matplotlib import pyplot
pyplot.text(0, 0, "<--", family='monospace')
pyplot.show()

Using matplotlib-0.99.3.win32-py2.6, the text '<--' is drawn with an
x-offset from the y-axis, as expected from the presence of leading
whitespace.

Using matplotlib-1.0.svn.win32-py2.6 rev 8347, the leading whitespace is
apparently removed from the text and '<--' is drawn right at the y-axis
with no x-offset.

In both cases the font is monospace.

Is this change intended or a regression in 1.0svn?
         

Christoph,

I haven't had a chance to try this out with my machine that has MPL 1.0svn on it, but is there any chance that you have mpl.rcParams['text.usetex'] = True when you get the error?

Hi Paul,

no, usetex is not set, I made sure of that. I have traced this to a
recent commit and opened a ticket on SF.

<http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/src/ft2font.cpp?r1=7635&r2=7838>
<http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/src/ft2font.cpp?r1=7838&r2=7839>

<http://sourceforge.net/tracker/?func=detail&aid=3010045&group_id=80706&atid=560720>

Thanks for doing that. I have assigned it to Mike D. I hope he has a
little time to look at it. I suspect he will instantly see what the
problem is and how to fix it.

Eric

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   
--
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA