@@ -794,7 +794,9 @@ class RegularPolygon(Patch):
794794 A regular polygon patch.
795795 """
796796 def __str__ (self ):
797- return "Poly%d(%g,%g)" % (self ._numVertices , self ._xy [0 ], self ._xy [1 ])
797+ s = "RegularPolygon((%g, %g), %d, radius=%g, orientation=%g)"
798+ return s % (self ._xy [0 ], self ._xy [1 ], self ._numVertices , self ._radius ,
799+ self ._orientation )
798800
799801 @docstring .dedent_interpd
800802 def __init__ (self , xy , numVertices , radius = 5 , orientation = 0 ,
@@ -880,7 +882,8 @@ class PathPatch(Patch):
880882 _edge_default = True
881883
882884 def __str__ (self ):
883- return "Poly((%g, %g) ...)" % tuple (self ._path .vertices [0 ])
885+ s = "PathPatch%d((%g, %g) ...)"
886+ return s % (len (self ._path .vertices ), * tuple (self ._path .vertices [0 ]))
884887
885888 @docstring .dedent_interpd
886889 def __init__ (self , path , ** kwargs ):
@@ -908,7 +911,8 @@ class Polygon(Patch):
908911 A general polygon patch.
909912 """
910913 def __str__ (self ):
911- return "Poly((%g, %g) ...)" % tuple (self ._path .vertices [0 ])
914+ s = "Polygon%d((%g, %g) ...)"
915+ return s % (len (self ._path .vertices ), * tuple (self ._path .vertices [0 ]))
912916
913917 @docstring .dedent_interpd
914918 def __init__ (self , xy , closed = True , ** kwargs ):
@@ -1381,7 +1385,8 @@ class CirclePolygon(RegularPolygon):
13811385 A polygon-approximation of a circle patch.
13821386 """
13831387 def __str__ (self ):
1384- return "CirclePolygon(%d,%d)" % self .center
1388+ s = "CirclePolygon((%g, %g), radius=%g, resolution=%d)"
1389+ return s % (self ._xy [0 ], self ._xy [1 ], self ._radius , self ._numVertices )
13851390
13861391 @docstring .dedent_interpd
13871392 def __init__ (self , xy , radius = 5 ,
@@ -2451,9 +2456,8 @@ class FancyBboxPatch(Patch):
24512456 _edge_default = True
24522457
24532458 def __str__ (self ):
2454- return self .__class__ .__name__ \
2455- + "(%g,%g;%gx%g)" % (self ._x , self ._y ,
2456- self ._width , self ._height )
2459+ s = self .__class__ .__name__ + "((%g, %g), width=%g, height=%g)"
2460+ return s % (self ._x , self ._y , self ._width , self ._height )
24572461
24582462 @docstring .dedent_interpd
24592463 def __init__ (self , xy , width , height ,
@@ -3966,7 +3970,7 @@ def __str__(self):
39663970 if self ._posA_posB is not None :
39673971 (x1 , y1 ), (x2 , y2 ) = self ._posA_posB
39683972 return self .__class__ .__name__ \
3969- + "(%g,%g-> %g,%g )" % (x1 , y1 , x2 , y2 )
3973+ + "(( %g, %g)->( %g, %g) )" % (x1 , y1 , x2 , y2 )
39703974 else :
39713975 return self .__class__ .__name__ \
39723976 + "(%s)" % (str (self ._path_original ),)
@@ -4374,7 +4378,7 @@ class ConnectionPatch(FancyArrowPatch):
43744378 connecting lines between two points (possibly in different axes).
43754379 """
43764380 def __str__ (self ):
4377- return "ConnectionPatch((%g,%g),(%g,%g))" % \
4381+ return "ConnectionPatch((%g, %g), (%g, %g))" % \
43784382 (self .xy1 [0 ], self .xy1 [1 ], self .xy2 [0 ], self .xy2 [1 ])
43794383
43804384 @docstring .dedent_interpd
0 commit comments