8000 `zeros_like(x) + y` -> `full_like(x, y)` · matplotlib/matplotlib@1552aa8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1552aa8

Browse files
committed
zeros_like(x) + y -> full_like(x, y)
1 parent 6e8d6e9 commit 1552aa8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

examples/statistics/errorbar_limits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
# Plot a series with lower and upper limits in both x & y
5353
# constant x-error with varying y-error
5454
xerr = 0.2
55-
yerr = np.zeros_like(x) + 0.2
55+
yerr = np.full_like(x, 0.2)
5656
yerr[[3, 6]] = 0.3
5757

5858
# mock up some limits by modifying previous data

lib/matplotlib/tests/test_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2949,7 +2949,7 @@ def test_errorbar_limits():
29492949

29502950
# including xlower and xupper limits
29512951
xerr = 0.2
2952-
yerr = np.zeros_like(x) + 0.2
2952+
yerr = np.full_like(x, 0.2)
29532953
yerr[[3, 6]] = 0.3
29542954
xlolims = lolims
29552955
xuplims = uplims

lib/mpl_toolkits/axisartist/grid_finder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ def _get_raw_grid_lines(self,
125125
lons_i = np.linspace(lon_min, lon_max, 100) # for interpolation
126126
lats_i = np.linspace(lat_min, lat_max, 100)
127127

128-
lon_lines = [self.transform_xy(np.zeros_like(lats_i) + lon, lats_i)
128+
lon_lines = [self.transform_xy(np.full_like(lats_i, lon), lats_i)
129129
for lon in lon_values]
130-
lat_lines = [self.transform_xy(lons_i, np.zeros_like(lons_i) + lat)
130+
lat_lines = [self.transform_xy(lons_i, np.full_like(lons_i, lat))
131131
for lat in lat_values]
132132

133133
return lon_lines, lat_lines

0 commit comments

Comments
 (0)
0