Skip to content
Closed
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
12 changes: 6 additions & 6 deletions lib/matplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def to_rgba_array(c, alpha=None):
" of alpha values if there are more than one"
" of each.")
if c.shape[1] == 3:
result = np.column_stack([c, np.zeros(len(c))])
result = np.hstack([c, np.zeros(len(c)).reshape(-1, 1)])
result[:, -1] = alpha if alpha is not None else 1.
elif c.shape[1] == 4:
result = c.copy()
Expand Down Expand Up @@ -527,7 +527,7 @@ def to_rgba_array(c, alpha=None):
if isinstance(c, Sequence):
lens = {len(cc) if isinstance(cc, (list, tuple)) else -1 for cc in c}
if lens == {3}:
rgba = np.column_stack([c, np.ones(len(c))])
rgba = np.hstack([c, np.ones(len(c)).reshape(-1, 1)])
elif lens == {4}:
rgba = np.array(c)
else:
Expand Down Expand Up @@ -1231,10 +1231,10 @@ def from_list(name, colors, N=256, gamma=1.0, *, bad=None, under=None, over=None
r, g, b, a = to_rgba_array(_colors).T

cdict = {
"red": np.column_stack([vals, r, r]),
"green": np.column_stack([vals, g, g]),
"blue": np.column_stack([vals, b, b]),
"alpha": np.column_stack([vals, a, a]),
"red": np.vstack([vals, r, r]).T,
"green": np.vstack([vals, g, g]).T,
"blue": np.vstack([vals, b, b]).T,
"alpha": np.vstack([vals, a, a]).T,
}

return LinearSegmentedColormap(name, cdict, N, gamma,
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ def recache(self, always=False):
else:
y = self._y

self._xy = np.column_stack(np.broadcast_arrays(x, y)).astype(float)
self._xy = np.vstack(np.broadcast_arrays(x, y)).T.astype(float)
self._x, self._y = self._xy.T # views

self._subslice = False
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ def _update_path(self):
else: # no baseline
raise ValueError('Invalid `baseline` specified')
if self.orientation == 'vertical':
xy = np.column_stack([x, y])
xy = np.vstack([x, y]).T
else:
xy = np.column_stack([y, x])
verts.append(xy)
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ def unit_regular_polygon(cls, numVertices):
# This initial rotation is to make sure the polygon always
# "points-up".
+ np.pi / 2)
verts = np.column_stack((np.cos(theta), np.sin(theta)))
verts = np.vstack((np.cos(theta), np.sin(theta))).T
path = cls(verts, closed=True, readonly=True)
if numVertices <= 16:
cls._unit_regular_polygons[numVertices] = path
Expand Down
Loading