@@ -49,7 +49,7 @@ def get_rotation(self):
49
49
50
50
51
51
class ContourLabeler :
52
- ''' Mixin to provide labelling capability to ContourSet'''
52
+ """ Mixin to provide labelling capability to ContourSet"""
53
53
54
54
def clabel (self , * args , ** kwargs ):
55
55
"""
@@ -620,7 +620,7 @@ def add_label_near(self, x, y, inline=True, inline_spacing=5,
620
620
paths .append (mpath .Path (n ))
621
621
622
622
def pop_label (self , index = - 1 ):
623
- ''' Defaults to removing last label, but any index can be supplied'''
623
+ """ Defaults to removing last label, but any index can be supplied"""
624
624
self .labelCValues .pop (index )
625
625
t = self .labelTexts .pop (index )
626
626
t .remove ()
@@ -687,7 +687,7 @@ def labels(self, inline, inline_spacing):
687
687
688
688
689
689
def _find_closest_point_on_leg (p1 , p2 , p0 ):
690
- ''' find closest point to p0 on line segment connecting p1 and p2'''
690
+ """ find closest point to p0 on line segment connecting p1 and p2"""
691
691
692
692
# handle degenerate case
693
693
if np .all (p2 == p1 ):
@@ -712,10 +712,10 @@ def _find_closest_point_on_leg(p1, p2, p0):
712
712
713
713
714
714
def _find_closest_point_on_path (lc , point ):
715
- '''
715
+ """
716
716
lc: coordinates of vertices
717
717
point: coordinates of test point
718
- '''
718
+ """
719
719
720
720
# find index of closest vertex for this segment
721
721
ds = np .sum ((lc - point [None , :])** 2 , 1 )
@@ -1102,7 +1102,7 @@ def changed(self):
1102
1102
cm .ScalarMappable .changed (self )
1103
1103
1104
1104
def _autolev (self , z , N ):
1105
- '''
1105
+ """
1106
1106
Select contour levels to span the data.
1107
1107
1108
1108
We need two more levels for filled contours than for
@@ -1111,7 +1111,7 @@ def _autolev(self, z, N):
1111
1111
a single contour boundary, say at z = 0, requires only
1112
1112
one contour line, but two filled regions, and therefore
1113
1113
three levels to provide boundaries for both regions.
1114
- '''
1114
+ """
1115
1115
if self .locator is None :
1116
1116
if self .logscale :
1117
1117
self .locator = ticker .LogLocator ()
@@ -1280,11 +1280,11 @@ def _process_linestyles(self):
1280
1280
return tlinestyles
1281
1281
1282
1282
def get_alpha (self ):
1283
- ''' returns alpha to be applied to all ContourSet artists'''
1283
+ """ returns alpha to be applied to all ContourSet artists"""
1284
1284
return self .alpha
1285
1285
1286
1286
def set_alpha (self , alpha ):
1287
- ''' sets alpha for all ContourSet artists'''
1287
+ """ sets alpha for all ContourSet artists"""
1288
1288
self .alpha = alpha
1289
1289
self .changed ()
1290
1290
@@ -1479,14 +1479,14 @@ def _contour_args(self, args, kwargs):
1479
1479
return (x , y , z )
1480
1480
1481
1481
def _check_xyz (self , args , kwargs ):
1482
- '''
1482
+ """
1483
1483
For functions like contour, check that the dimensions
1484
1484
of the input arrays match; if x and y are 1D, convert
1485
1485
them to 2D using meshgrid.
1486
1486
1487
1487
Possible change: I think we should make and use an ArgumentError
1488
1488
Exception class (here and elsewhere).
1489
- '''
1489
+ """
1490
1490
x , y = args [:2 ]
1491
1491
self .ax ._process_unit_info (xdata = x , ydata = y , kwargs = kwargs )
1492
1492
x = self .ax .convert_xunits (x )
@@ -1534,7 +1534,7 @@ def _check_xyz(self, args, kwargs):
1534
1534
return x , y , z
1535
1535
1536
1536
def _initialize_x_y (self , z ):
1537
- '''
1537
+ """
1538
1538
Return X, Y arrays such that contour(Z) will match imshow(Z)
1539
1539
if origin is not None.
1540
1540
The center of pixel Z[i,j] depends on origin:
@@ -1545,7 +1545,7 @@ def _initialize_x_y(self, z):
1545
1545
as in imshow.
1546
1546
If origin is None and extent is not None, then extent
1547
1547
will give the minimum and maximum values of x and y.
1548
- '''
1548
+ """
1549
1549
if z .ndim != 2 :
1550
1550
raise TypeError ("Input must be a 2D array." )
1551
1551
else :
0 commit comments