Revision: 3866
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3866&view=rev
Author:   mdboom
Date:     2007-09-20 06:59:15 -0700 (Thu, 20 Sep 2007)

Log Message:
-----------
Merged revisions 3847-3865 via svnmerge from 
http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib

........
  r3853 | jouni | 2007-09-15 00:01:56 -0400 (Sat, 15 Sep 2007) | 2 lines
  
  Bugfix and doc fixes in type1font.py
........
  r3861 | mdboom | 2007-09-20 08:31:26 -0400 (Thu, 20 Sep 2007) | 2 lines
  
  Fix font.size from being saved in the fontManager.cache
........
  r3862 | mdboom | 2007-09-20 08:40:41 -0400 (Thu, 20 Sep 2007) | 2 lines
  
  Removing debugging output in last commit.
........
  r3863 | jdh2358 | 2007-09-20 09:50:27 -0400 (Thu, 20 Sep 2007) | 1 line
  
  added gradient bar example
........

Modified Paths:
--------------
    branches/transforms/lib/matplotlib/font_manager.py

Added Paths:
-----------
    branches/transforms/examples/gradient_bar.py

Property Changed:
----------------
    branches/transforms/


Property changes on: branches/transforms
___________________________________________________________________
Name: svnmerge-integrated
   - /trunk/matplotlib:1-3846
   + /trunk/matplotlib:1-3865

Copied: branches/transforms/examples/gradient_bar.py (from rev 3863, 
trunk/matplotlib/examples/gradient_bar.py)
===================================================================
--- branches/transforms/examples/gradient_bar.py                                
(rev 0)
+++ branches/transforms/examples/gradient_bar.py        2007-09-20 13:59:15 UTC 
(rev 3866)
@@ -0,0 +1,26 @@
+from pylab import figure, show, nx, cm
+
+def gbar(ax, x, y, width=0.5, bottom=0):
+   X = [[.6, .6],[.7,.7]]
+   for left,top in zip(x, y):
+       right = left+width
+       ax.imshow(X, interpolation='bicubic', cmap=cm.Blues,
+                 extent=(left, right, bottom, top), alpha=1)
+
+fig = figure()
+
+xmin, xmax = xlim = 0,10
+ymin, ymax = ylim = 0,1
+ax = fig.add_subplot(111, xlim=xlim, ylim=ylim,
+                    autoscale_on=False)
+X = [[.6, .6],[.7,.7]]
+
+ax.imshow(X, interpolation='bicubic', cmap=cm.copper,
+         extent=(xmin, xmax, ymin, ymax), alpha=1)
+
+N = 10
+x = nx.arange(N)+0.25
+y = nx.mlab.rand(N)
+gbar(ax, x, y, width=0.7)
+ax.set_aspect('normal')
+show()

Modified: branches/transforms/lib/matplotlib/font_manager.py
===================================================================
--- branches/transforms/lib/matplotlib/font_manager.py  2007-09-20 13:57:59 UTC 
(rev 3865)
+++ branches/transforms/lib/matplotlib/font_manager.py  2007-09-20 13:59:15 UTC 
(rev 3866)
@@ -843,10 +843,9 @@
     """
 
     def __init__(self, size=None, weight='normal'):
-        if not size : size = rcParams['font.size']
-        self.__default_size = size
         self.__default_weight = weight
-
+        self.default_size = size
+        
         paths = [os.path.join(rcParams['datapath'],'fonts','ttf'),
                  os.path.join(rcParams['datapath'],'fonts','afm')]
 
@@ -899,7 +898,9 @@
 
     def get_default_size(self):
         "Return the default font size."
-        return self.__default_size
+        if self.default_size is None:
+            return rcParams['font.size']
+        return self.default_size
 
     def set_default_weight(self, weight):
         "Set the default font weight.  The initial value is 'normal'."
@@ -1085,6 +1086,7 @@
 
     try:
         fontManager = pickle_load(_fmcache)
+        fontManager.default_size = None
         verbose.report("Using fontManager instance from %s" % _fmcache)
     except:
         _rebuild()


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to