You can just do
ax.legend(prop=fm.FontProperties('Tahoma'))
Cheers,
Mike
sa6113 wrote:
> I want to set font name to 'tahoma.ttf' this code work propely but is there
> any way I don't want to use full path name in fname property.
>
> import matplotlib.font_manager as fm
> import matplotlib.pyplot as plt
>
> fig = plt.figure()
> ax = fig.add_subplot(111)
> ax.plot([1,2,3], label='test')
>
> ax.legend(prop=fm.FontProperties(fname='c:/windows/fonts/tahoma.ttf'))
> plt.show()
>
--
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users