Revision: 7101
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7101&view=rev
Author:   leejjoon
Date:     2009-05-14 04:00:38 +0000 (Thu, 14 May 2009)

Log Message:
-----------
psfrag in backend_ps now uses baseline-alignment when preview.sty is used

Modified Paths:
--------------
    trunk/matplotlib/CHANGELOG
    trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
    trunk/matplotlib/lib/matplotlib/offsetbox.py

Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG  2009-05-13 19:59:16 UTC (rev 7100)
+++ trunk/matplotlib/CHANGELOG  2009-05-14 04:00:38 UTC (rev 7101)
@@ -1,4 +1,9 @@
 ======================================================================
+2009-05-13 psfrag in backend_ps now uses baseline-alignment 
+           when preview.sty is used ((default is
+           bottom-alignment). Also, a small api imporvement 
+           in OffsetBox-JJL
+
 2009-05-13 When the x-coordinate of a line is monotonically
            increasing, it is now automatically clipped at
            the stage of generating the transformed path in
@@ -6,7 +11,7 @@
            panning when one is looking at a short segment of
            a long time series, for example. - EF
 
-2009-05-11 aspect=1 in log-log plot gives square decades.
+2009-05-11 aspect=1 in log-log plot gives square decades. -JJL
 
 2009-05-08 clabel takes new kwarg, rightside_up; if False, labels
            will not be flipped to keep them rightside-up.  This

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py      2009-05-13 
19:59:16 UTC (rev 7100)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py      2009-05-14 
04:00:38 UTC (rev 7101)
@@ -537,8 +537,6 @@
         """
         w, h, bl = self.get_text_width_height_descent(s, prop, ismath)
         fontsize = prop.get_size_in_points()
-        corr = 0#w/2*(fontsize-10)/10
-        pos = _nums_to_str(x-corr, y)
         thetext = 'psmarker%d' % self.textcnt
         color = '%1.3f,%1.3f,%1.3f'% gc.get_rgb()[:3]
         fontcmd = {'sans-serif' : r'{\sffamily %s}',
@@ -546,7 +544,17 @@
                 rcParams['font.family'], r'{\rmfamily %s}')
         s = fontcmd % s
         tex = r'\color[rgb]{%s} %s' % (color, s)
-        
self.psfrag.append(r'\psfrag{%s}[bl][bl][1][%f]{\fontsize{%f}{%f}%s}'%(thetext, 
angle, fontsize, fontsize*1.25, tex))
+
+        corr = 0#w/2*(fontsize-10)/10
+        if rcParams['text.latex.preview']:
+            # use baseline alignment!
+            pos = _nums_to_str(x-corr, y+bl)
+            
self.psfrag.append(r'\psfrag{%s}[Bl][Bl][1][%f]{\fontsize{%f}{%f}%s}'%(thetext, 
angle, fontsize, fontsize*1.25, tex))
+        else:
+            # stick to the bottom alignment, but this may give incorrect 
baseline some times.
+            pos = _nums_to_str(x-corr, y)
+            
self.psfrag.append(r'\psfrag{%s}[bl][bl][1][%f]{\fontsize{%f}{%f}%s}'%(thetext, 
angle, fontsize, fontsize*1.25, tex))
+
         ps = """\
 gsave
 %(pos)s moveto

Modified: trunk/matplotlib/lib/matplotlib/offsetbox.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/offsetbox.py        2009-05-13 19:59:16 UTC 
(rev 7100)
+++ trunk/matplotlib/lib/matplotlib/offsetbox.py        2009-05-14 04:00:38 UTC 
(rev 7101)
@@ -782,11 +782,14 @@
     explicitly specify the bbox_to_anchor.
     """
 
+    zorder = 5 # zorder of the legend
+
     def __init__(self, loc,
                  pad=0.4, borderpad=0.5,
                  child=None, prop=None, frameon=True,
                  bbox_to_anchor=None,
-                 bbox_transform=None):
+                 bbox_transform=None,
+                 **kwargs):
         """
         loc is a string or an integer specifying the legend location.
         The valid  location codes are::
@@ -819,7 +822,7 @@
 
         """
 
-        super(AnchoredOffsetbox, self).__init__()
+        super(AnchoredOffsetbox, self).__init__(**kwargs)
 
         self.set_bbox_to_anchor(bbox_to_anchor, bbox_transform)
         self.set_child(child)


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

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to