@@ -983,8 +983,8 @@ def __call__(self, x, pos=None):
983
983
# only label the decades
984
984
fx = math .log (x ) / math .log (b )
985
985
is_x_decade = _is_close_to_int (fx )
986
- exponent = round (fx ) if is_x_decade else np .floor (fx )
987
- coeff = round (b ** (fx - exponent ))
986
+ exponent = np . round (fx ) if is_x_decade else np .floor (fx )
987
+ coeff = np . round (b ** (fx - exponent ))
988
988
989
989
if self .labelOnlyBase and not is_x_decade :
990
990
return ''
@@ -1064,16 +1064,16 @@ def __call__(self, x, pos=None):
1064
1064
# only label the decades
1065
1065
fx = math .log (x ) / math .log (b )
1066
1066
is_x_decade = _is_close_to_int (fx )
1067
- exponent = round (fx ) if is_x_decade else np .floor (fx )
1068
- coeff = round (b ** (fx - exponent ))
1067
+ exponent = np . round (fx ) if is_x_decade else np .floor (fx )
1068
+ coeff = np . round (b ** (fx - exponent ))
1069
1069
1070
1070
if self .labelOnlyBase and not is_x_decade :
1071
1071
return ''
1072
1072
if self ._sublabels is not None and coeff not in self ._sublabels :
1073
1073
return ''
1074
1074
1075
1075
if is_x_decade :
1076
- fx = round (fx )
1076
+ fx = np . round (fx )
1077
1077
1078
1078
# use string formatting of the base if it is not an integer
1079
1079
if b % 1 == 0.0 :
@@ -1101,7 +1101,7 @@ def _non_decade_format(self, sign_string, base, fx, usetex):
1101
1101
exponent = math .floor (fx )
1102
1102
coeff = b ** (fx - exponent )
1103
1103
if _is_close_to_int (coeff ):
1104
- coeff = round (coeff )
1104
+ coeff = np . round (coeff )
1105
1105
return r'$\mathdefault{%s%g\times%s^{%d}}$' \
1106
1106
% (sign_string , coeff , base , exponent )
1107
1107
@@ -1276,13 +1276,13 @@ def __call__(self, x, pos=None):
1276
1276
return ""
1277
1277
if x <= 0 or x >= 1 :
1278
1278
return ""
1279
- if _is_close_to_int (2 * x ) and round (2 * x ) == 1 :
1279
+ if _is_close_to_int (2 * x ) and np . round (2 * x ) == 1 :
1280
1280
s = self ._one_half
1281
1281
elif x < 0.5 and _is_decade (x , rtol = 1e-7 ):
1282
- exponent = round (math .log10 (x ))
1282
+ exponent = np . round (math .log10 (x ))
1283
1283
s = "10^{%d}" % exponent
1284
1284
elif x > 0.5 and _is_decade (1 - x , rtol = 1e-7 ):
1285
- exponent = round (math .log10 (1 - x ))
1285
+ exponent = np . round (math .log10 (1 - x ))
1286
1286
s = self ._one_minus ("10^{%d}" % exponent )
1287
1287
elif x < 0.1 :
1288
1288
s = self ._format_value (x , self .locs )
@@ -2239,7 +2239,7 @@ def _decade_greater(x, base):
2239
2239
2240
2240
2241
2241
def _is_close_to_int (x ):
2242
- return math .isclose (x , round (x ))
2242
+ return math .isclose (x , np . round (x ))
2243
2243
2244
2244
2245
2245
class LogLocator (Locator ):
@@ -2904,8 +2904,8 @@ def __call__(self):
2904
2904
2905
2905
vmin , vmax = sorted (self .axis .get_view_interval ())
2906
2906
t0 = majorlocs [0 ]
2907
- tmin = round ((vmin - t0 ) / minorstep )
2908
- tmax = round ((vmax - t0 ) / minorstep ) + 1
2907
+ tmin = np . round ((vmin - t0 ) / minorstep )
2908
+ tmax = np . round ((vmax - t0 ) / minorstep ) + 1
2909
2909
locs = (np .arange (tmin , tmax ) * minorstep ) + t0
2910
2910
2911
2911
return self .raise_if_exceeds (locs )
0 commit comments