Re: [Matplotlib-users] Use a marker symbol in a text string

2010-11-25 Thread Gökhan Sever
On Wed, Nov 24, 2010 at 8:38 AM, Alejandro Weinstein
 wrote:
> On Tue, Nov 23, 2010 at 9:37 AM, Gökhan Sever  wrote:
>> As I have learnt from Michael Droettboom, you can simply use unicode
>> characters with a supported font set:
>> In my setup I prefer DejaVu-Sans. First install these fonts into your
>> system, then edit your matplotlibrc
>
> Thanks for the answer. But I think there must be an easier way without
> the need to install anything. After all, the legend command is able to
> create text using the markers.
>
> Alejandro.
>

You have three options then:

1-) Figure out how legend handles symbol drawing.
2-) Use latex / mathtext to represent symbols.
3-) Install a font and more intuitively insert a sqaure box into your string.

For me, as long as the expression that is drawn on screen is not
complicated, I am very happy using the unicode text approach.

-- 
Gökhan

--
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] small bugfix in font_manager.py

2010-11-25 Thread Benjamin Root
On Wednesday, November 24, 2010, Daniel Hyams  wrote:
> MPL 1.0.0, OSX
> If USE_FONTCONFIG is turned on, the function 
> FontProperties.get_size_in_points will sometimes fail, because it is wanting 
> to use "fontManager", which is still 'None' if USE_FONTCONFIG is on.  I'm not 
> sure if it's the proper way to fix it, but here is a small patch that works 
> (meaning that at least the code doesn't die; I can't vouch for much else):
>
>
> ORIGINAL:
>     def get_size_in_points(self):        if self._size is not None:           
>  try:                return float(self._size)
>
>             except ValueError:                pass        default_size = 
> fontManager.get_default_size()        return default_size * 
> font_scalings.get(self._size)
>
>
> NEW:
>     def get_size_in_points(self):        if self._size is not None:           
>  try:                return float(self._size)            except ValueError:
>
>                 pass        if fontManager:            default_size = 
> fontManager.get_default_size()        else:           default_size = 
> rcParams['font.size']
>
>         return default_size * font_scalings.get(self._size)
>
> --
> Daniel Hyams
> dhy...@gmail.com
>
>

I personally think that this is reasonable, as it guarantees a size
value to come from somewhere.  However, I am concerned about
fontManager being None. If it isn't a bug for it to be None at this
point, then I have to wonder where-else in the code needs a check for
None?  If it is a bug, then what should it be when USE_FONTCONFIG is
true?

Good catch Daniel.

Ben Root

--
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users