Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4810,8 +4810,8 @@ def reduce_C_function(C: array) -> float
else:
lattice2[i, j] = np.nan

accum = np.hstack((lattice1.astype(float).ravel(),
lattice2.astype(float).ravel()))
accum = np.concatenate([lattice1.astype(float).ravel(),
lattice2.astype(float).ravel()])
good_idxs = ~np.isnan(accum)

offsets = np.zeros((n, 2), float)
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/cbook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ def _compute_conf_interval(data, med, iqr, bootstrap):
stats['whislo'] = np.min(wisklo)

# compute a single array of outliers
stats['fliers'] = np.hstack([
stats['fliers'] = np.concatenate([
x[x < stats['whislo']],
x[x > stats['whishi']],
])
Expand Down
27 changes: 14 additions & 13 deletions lib/matplotlib/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,10 @@ def _set_star(self):
else:
verts = polypath.vertices

top = Path(np.vstack((verts[0:4, :], verts[7:10, :], verts[0])))
bottom = Path(np.vstack((verts[3:8, :], verts[3])))
left = Path(np.vstack((verts[0:6, :], verts[0])))
right = Path(np.vstack((verts[0], verts[5:10, :], verts[0])))
top = Path(np.concatenate([verts[0:4], verts[7:10], verts[0:1]]))
bottom = Path(np.concatenate([verts[3:8], verts[3:4]]))
left = Path(np.concatenate([verts[0:6], verts[0:1]]))
right = Path(np.concatenate([verts[0:1], verts[5:10], verts[0:1]]))

if fs == 'top':
mpath, mpath_alt = top, bottom
Expand Down Expand Up @@ -641,10 +641,10 @@ def _set_hexagon1(self):

# not drawing inside lines
x = np.abs(np.cos(5 * np.pi / 6.))
top = Path(np.vstack(([-x, 0], verts[(1, 0, 5), :], [x, 0])))
bottom = Path(np.vstack(([-x, 0], verts[2:5, :], [x, 0])))
left = Path(verts[(0, 1, 2, 3), :])
right = Path(verts[(0, 5, 4, 3), :])
top = Path(np.concatenate([[(-x, 0)], verts[[1, 0, 5]], [(x, 0)]]))
bottom = Path(np.concatenate([[(-x, 0)], verts[2:5], [(x, 0)]]))
left = Path(verts[0:4])
right = Path(verts[[0, 5, 4, 3]])

if fs == 'top':
mpath, mpath_alt = top, bottom
Expand Down Expand Up @@ -675,11 +675,12 @@ def _set_hexagon2(self):

# not drawing inside lines
x, y = np.sqrt(3) / 4, 3 / 4.
top = Path(verts[(1, 0, 5, 4, 1), :])
bottom = Path(verts[(1, 2, 3, 4), :])
left = Path(np.vstack(([x, y], verts[(0, 1, 2), :],
[-x, -y], [x, y])))
right = Path(np.vstack(([x, y], verts[(5, 4, 3), :], [-x, -y])))
top = Path(verts[[1, 0, 5, 4, 1]])
bottom = Path(verts[1:5])
left = Path(np.concatenate([
[(x, y)], verts[:3], [(-x, -y), (x, y)]]))
right = Path(np.concatenate([
[(x, y)], verts[5:2:-1], [(-x, -y)]]))

if fs == 'top':
mpath, mpath_alt = top, bottom
Expand Down
19 changes: 11 additions & 8 deletions lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,14 +994,14 @@ def _update_path(self):
x = np.repeat(self._edges[idx0:idx1+1], 2)
y = np.repeat(self._values[idx0:idx1], 2)
if self._baseline is None:
y = np.hstack((y[0], y, y[-1]))
y = np.concatenate([y[:1], y, y[-1:]])
elif self._baseline.ndim == 0: # single baseline value
y = np.hstack((self._baseline, y, self._baseline))
y = np.concatenate([[self._baseline], y, [self._baseline]])
elif self._baseline.ndim == 1: # baseline array
base = np.repeat(self._baseline[idx0:idx1], 2)[::-1]
x = np.concatenate([x, x[::-1]])
y = np.concatenate([np.hstack((base[-1], y, base[0],
base[0], base, base[-1]))])
y = np.concatenate([base[-1:], y, base[:1],
base[:1], base, base[-1:]])
else: # no baseline
raise ValueError('Invalid `baseline` specified')
if self.orientation == 'vertical':
Expand Down Expand Up @@ -1179,13 +1179,16 @@ def _recompute_path(self):
# followed by a reversed and scaled inner ring
v1 = arc.vertices
v2 = arc.vertices[::-1] * (self.r - self.width) / self.r
v = np.vstack([v1, v2, v1[0, :], (0, 0)])
c = np.hstack([arc.codes, arc.codes, connector, Path.CLOSEPOLY])
v = np.concatenate([v1, v2, [v1[0, :], (0, 0)]])
c = np.concatenate([
arc.codes, arc.codes, [connector, Path.CLOSEPOLY]])
c[len(arc.codes)] = connector
else:
# Wedge doesn't need an inner ring
v = np.vstack([arc.vertices, [(0, 0), arc.vertices[0, :], (0, 0)]])
c = np.hstack([arc.codes, [connector, connector, Path.CLOSEPOLY]])
v = np.concatenate([
arc.vertices, [(0, 0), arc.vertices[0, :], (0, 0)]])
c = np.concatenate([
arc.codes, [connector, connector, Path.CLOSEPOLY]])

# Shift and scale the wedge to the final location.
v *= self.r
Expand Down
12 changes: 5 additions & 7 deletions lib/matplotlib/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2139,18 +2139,16 @@ def _validate_steps(steps):
raise ValueError('steps argument must be an increasing sequence '
'of numbers between 1 and 10 inclusive')
if steps[0] != 1:
steps = np.hstack((1, steps))
steps = np.concatenate([[1], steps])
if steps[-1] != 10:
steps = np.hstack((steps, 10))
steps = np.concatenate([steps, [10]])
return steps

@staticmethod
def _staircase(steps):
# Make an extended staircase within which the needed
# step will be found. This is probably much larger
# than necessary.
flights = (0.1 * steps[:-1], steps, 10 * steps[1])
return np.hstack(flights)
# Make an extended staircase within which the needed step will be
# found. This is probably much larger than necessary.
return np.concatenate([0.1 * steps[:-1], steps, [10 * steps[1]]])

def set_params(self, **kwargs):
"""
Expand Down