Revision: 8017
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8017&view=rev
Author:   leejjoon
Date:     2009-12-10 19:05:35 +0000 (Thu, 10 Dec 2009)

Log Message:
-----------
add BracketAB arrow style

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/patches.py

Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py  2009-12-10 00:09:03 UTC (rev 
8016)
+++ trunk/matplotlib/lib/matplotlib/patches.py  2009-12-10 19:05:35 UTC (rev 
8017)
@@ -3193,7 +3193,7 @@
                 cos_t, sin_t = get_cos_sin(x1, y1, x0, y0)
                 verticesA, codesA = self._get_bracket(x0, y0, cos_t, sin_t,
                                                       self.widthA*scaleA,
-                                                      self.legnthA*scaleA)
+                                                      self.lengthA*scaleA)
                 vertices_list.append(verticesA)
                 codes_list.append(codesA)
 
@@ -3218,7 +3218,64 @@
 
             return p, False
 
+    class BracketAB(_Bracket):
+        """
+        An arrow with a bracket(])  at both ends.
+        """
 
+        def __init__(self,
+                     widthA=1., lengthA=0.2, angleA=None,
+                     widthB=1., lengthB=0.2, angleB=None):
+            """
+            *widthA*
+              width of the bracket
+
+            *lengthA*
+              length of the bracket
+
+            *angleA*
+              angle between the bracket and the line
+
+            *widthB*
+              width of the bracket
+
+            *lengthB*
+              length of the bracket
+
+            *angleB*
+              angle between the bracket and the line
+            """
+
+            super(ArrowStyle.BracketAB, self).__init__(True, True, \
+                        widthA=widthA, lengthA=lengthA, angleA=angleA,
+                        widthB=widthB, lengthB=lengthB, angleB=angleB)
+
+    _style_list["]-["] = BracketAB
+
+
+    class BracketA(_Bracket):
+        """
+        An arrow with a bracket(])  at its end.
+        """
+
+        def __init__(self, widthA=1., lengthA=0.2, angleA=None):
+            """
+            *widthA*
+              width of the bracket
+
+            *lengthA*
+              length of the bracket
+
+            *angleA*
+              angle between the bracket and the line
+            """
+
+            super(ArrowStyle.BracketA, self).__init__(None, True,
+                     widthA=widthA, lengthA=lengthA, angleA=angleA )
+
+    _style_list["]-"] = BracketA
+
+
     class BracketB(_Bracket):
         """
         An arrow with a bracket([)  at its end.
@@ -3237,9 +3294,8 @@
             """
 
             super(ArrowStyle.BracketB, self).__init__(None, True,
-                     widthB=widthB, lengthB=lengthB, angleB=None )
+                     widthB=widthB, lengthB=lengthB, angleB=angleB )
 
-    #_style_list["-["] = BracketB
     _style_list["-["] = BracketB
 
 


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

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to