|
From: <jd...@us...> - 2008-09-13 17:07:41
|
Revision: 6092
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6092&view=rev
Author: jdh2358
Date: 2008-09-13 17:07:39 +0000 (Sat, 13 Sep 2008)
Log Message:
-----------
moved font examples to api
Added Paths:
-----------
trunk/matplotlib/examples/api/font_family_rc.py
trunk/matplotlib/examples/api/font_file.py
Removed Paths:
-------------
trunk/matplotlib/examples/pylab_examples/font_family_rc.py
trunk/matplotlib/examples/pylab_examples/font_file.py
Copied: trunk/matplotlib/examples/api/font_family_rc.py (from rev 6091, trunk/matplotlib/examples/pylab_examples/font_family_rc.py)
===================================================================
--- trunk/matplotlib/examples/api/font_family_rc.py (rev 0)
+++ trunk/matplotlib/examples/api/font_family_rc.py 2008-09-13 17:07:39 UTC (rev 6092)
@@ -0,0 +1,29 @@
+"""
+You can explicitly set which font family is picked up for a given font
+style (eg 'serif', 'sans-serif', or 'monospace').
+
+In the example below, we only allow one font family (Tahoma) for the
+san-serif font style. You the default family with the font.family rc
+param, eg::
+
+ rcParams['font.family'] = 'sans-serif'
+
+and for the font.family you set a list of font styles to try to find
+in order::
+
+ rcParams['font.sans-serif'] = ['Tahoma', 'Bitstream Vera Sans', 'Lucida Grande', 'Verdana']
+
+
+"""
+from matplotlib import rcParams
+rcParams['font.family'] = 'sans-serif'
+rcParams['font.sans-serif'] = ['Tahoma']
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+ax.plot([1,2,3], label='test')
+
+ax.legend()
+plt.show()
+
Copied: trunk/matplotlib/examples/api/font_file.py (from rev 6091, trunk/matplotlib/examples/pylab_examples/font_file.py)
===================================================================
--- trunk/matplotlib/examples/api/font_file.py (rev 0)
+++ trunk/matplotlib/examples/api/font_file.py 2008-09-13 17:07:39 UTC (rev 6092)
@@ -0,0 +1,18 @@
+"""
+Although it is usually not a good idea to explicitly point to a single
+ttf file for a font instance, you can do so using the
+font_manager.FontProperties fname argument (for a more flexible
+solution, see the font_fmaily_rc.py and fonts_demo.py examples).
+"""
+import matplotlib.font_manager as fm
+
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+ax.plot([1,2,3])
+
+prop = fm.FontProperties(fname='/Library/Fonts/Tahoma.ttf')
+ax.set_title('this is a special font', fontproperties=prop)
+plt.show()
+
Deleted: trunk/matplotlib/examples/pylab_examples/font_family_rc.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/font_family_rc.py 2008-09-13 17:06:53 UTC (rev 6091)
+++ trunk/matplotlib/examples/pylab_examples/font_family_rc.py 2008-09-13 17:07:39 UTC (rev 6092)
@@ -1,29 +0,0 @@
-"""
-You can explicitly set which font family is picked up for a given font
-style (eg 'serif', 'sans-serif', or 'monospace').
-
-In the example below, we only allow one font family (Tahoma) for the
-san-serif font style. You the default family with the font.family rc
-param, eg::
-
- rcParams['font.family'] = 'sans-serif'
-
-and for the font.family you set a list of font styles to try to find
-in order::
-
- rcParams['font.sans-serif'] = ['Tahoma', 'Bitstream Vera Sans', 'Lucida Grande', 'Verdana']
-
-
-"""
-from matplotlib import rcParams
-rcParams['font.family'] = 'sans-serif'
-rcParams['font.sans-serif'] = ['Tahoma']
-import matplotlib.pyplot as plt
-
-fig = plt.figure()
-ax = fig.add_subplot(111)
-ax.plot([1,2,3], label='test')
-
-ax.legend()
-plt.show()
-
Deleted: trunk/matplotlib/examples/pylab_examples/font_file.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/font_file.py 2008-09-13 17:06:53 UTC (rev 6091)
+++ trunk/matplotlib/examples/pylab_examples/font_file.py 2008-09-13 17:07:39 UTC (rev 6092)
@@ -1,18 +0,0 @@
-"""
-Although it is usually not a good idea to explicitly point to a single
-ttf file for a font instance, you can do so using the
-font_manager.FontProperties fname argument (for a more flexible
-solution, see the font_fmaily_rc.py and fonts_demo.py examples).
-"""
-import matplotlib.font_manager as fm
-
-import matplotlib.pyplot as plt
-
-fig = plt.figure()
-ax = fig.add_subplot(111)
-ax.plot([1,2,3])
-
-prop = fm.FontProperties(fname='/Library/Fonts/Tahoma.ttf')
-ax.set_title('this is a special font', fontproperties=prop)
-plt.show()
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|