FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Added broadcasting support in some mplot3d methods by WeatherGod · Pull Request #1074 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
18 changes: 3 additions & 15 deletions lib/mpl_toolkits/mplot3d/axes3d.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1352,15 +1352,9 @@ def plot_surface(self, X, Y, Z, *args, **kwargs):
had_data = self.has_data()

Z = np.atleast_2d(Z)
rows, cols = Z.shape
# TODO: Support masked arrays
X = np.asarray(X)
Y = np.asarray(Y)
# Force X and Y to take the same shape.
# If they can not be fitted to that shape,
# then an exception is automatically thrown.
X.shape = (rows, cols)
Y.shape = (rows, cols)
X, Y, Z = np.broadcast_arrays(X, Y, Z)
rows, cols = Z.shape

rstride = kwargs.pop('rstride', 10)
cstride = kwargs.pop('cstride', 10)
Expand Down Expand Up @@ -1526,14 +1520,8 @@ def plot_wireframe(self, X, Y, Z, *args, **kwargs):
had_data = self.has_data()
Z = np.atleast_2d(Z)
# FIXME: Support masked arrays
X = np.asarray(X)
Y = np.asarray(Y)
X, Y, Z = np.broadcast_arrays(X, Y, Z)
rows, cols = Z.shape
# Force X and Y to take the same shape.
# If they can not be fitted to that shape,
# then an exception is automatically thrown.
X.shape = (rows, cols)
Y.shape = (rows, cols)

# We want two sets of lines, one running along the "rows" of
# Z and another set of lines running along the "columns" of Z.
Expand Down

Back | FazBrowse Home | New Git URL