@@ -794,7 +794,9 @@ class RegularPolygon(Patch):
794
794
A regular polygon patch.
795
795
"""
796
796
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 )
798
800
799
801
@docstring .dedent_interpd
800
802
def __init__ (self , xy , numVertices , radius = 5 , orientation = 0 ,
@@ -880,7 +882,8 @@ class PathPatch(Patch):
880
882
_edge_default = True
881
883
882
884
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 ]))
884
887
885
888
@docstring .dedent_interpd
886
889
def __init__ (self , path , ** kwargs ):
@@ -908,7 +911,8 @@ class Polygon(Patch):
908
911
A general polygon patch.
909
912
"""
910
913
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 ]))
912
916
913
917
@docstring .dedent_interpd
914
918
def __init__ (self , xy , closed = True , ** kwargs ):
@@ -1381,7 +1385,8 @@ class CirclePolygon(RegularPolygon):
1381
1385
A polygon-approximation of a circle patch.
1382
1386
"""
1383
1387
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 )
1385
1390
1386
1391
@docstring .dedent_interpd
1387
1392
def __init__ (self , xy , radius = 5 ,
@@ -2451,9 +2456,8 @@ class FancyBboxPatch(Patch):
2451
2456
_edge_default = True
2452
2457
2453
2458
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 )
2457
2461
2458
2462
@docstring .dedent_interpd
2459
2463
def __init__ (self , xy , width , height ,
@@ -3966,7 +3970,7 @@ def __str__(self):
3966
3970
if self ._posA_posB is not None :
3967
3971
(x1 , y1 ), (x2 , y2 ) = self ._posA_posB
3968
3972
return self .__class__ .__name__ \
3969
- + "(%g,%g-> %g,%g )" % (x1 , y1 , x2 , y2 )
3973
+ + "(( %g, %g)->( %g, %g) )" % (x1 , y1 , x2 , y2 )
3970
3974
else :
3971
3975
return self .__class__ .__name__ \
3972
3976
+ "(%s)" % (str (self ._path_original ),)
@@ -4374,7 +4378,7 @@ class ConnectionPatch(FancyArrowPatch):
4374
4378
connecting lines between two points (possibly in different axes).
4375
4379
"""
4376
4380
def __str__ (self ):
4377
- return "ConnectionPatch((%g,%g),(%g,%g))" % \
4381
+ return "ConnectionPatch((%g, %g), (%g, %g))" % \
4378
4382
(self .xy1 [0 ], self .xy1 [1 ], self .xy2 [0 ], self .xy2 [1 ])
4379
4383
4380
4384
@docstring .dedent_interpd
0 commit comments