From 865d9646f3dfb7761df30eb511df3252e0624001 Mon Sep 17 00:00:00 2001 From: kislovskiy Date: Fri, 8 Oct 2021 21:46:09 +0200 Subject: [PATCH 1/3] Add description for XYZ in contour method --- lib/mpl_toolkits/mplot3d/axes3d.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py index b087229ce432..a18e52ea16d9 100644 --- a/lib/mpl_toolkits/mplot3d/axes3d.py +++ b/lib/mpl_toolkits/mplot3d/axes3d.py @@ -2103,8 +2103,18 @@ def contour(self, X, Y, Z, *args, Parameters ---------- - X, Y, Z : array-like - Input data. + X, Y : array-like, + The coordinates of the values in *Z*. + + *X* and *Y* must both be 2D with the same shape as *Z* (e.g. + created via `numpy.meshgrid`), or they must both be 1-D such + that ``len(X) == N`` is the number of columns in *Z* and + ``len(Y) == M`` is the number of rows in *Z*. + + If not given, they are assumed to be integer indices, i.e. + ``X = range(N)``, ``Y = range(M)``. + Z : (M, N) array-like + The height values over which the contour is drawn. extend3d : bool, default: False Whether to extend contour in 3D. stride : int From 0a7013ae0f25a32b1e0de2e1032e8f94da20ad6e Mon Sep 17 00:00:00 2001 From: kislovskiy Date: Fri, 8 Oct 2021 22:36:13 +0200 Subject: [PATCH 2/3] tested descreption --- lib/mpl_toolkits/mplot3d/axes3d.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py index a18e52ea16d9..4742540fe524 100644 --- a/lib/mpl_toolkits/mplot3d/axes3d.py +++ b/lib/mpl_toolkits/mplot3d/axes3d.py @@ -2104,17 +2104,15 @@ def contour(self, X, Y, Z, *args, Parameters ---------- X, Y : array-like, - The coordinates of the values in *Z*. - - *X* and *Y* must both be 2D with the same shape as *Z* (e.g. - created via `numpy.meshgrid`), or they must both be 1-D such - that ``len(X) == N`` is the number of columns in *Z* and - ``len(Y) == M`` is the number of rows in *Z*. - - If not given, they are assumed to be integer indices, i.e. - ``X = range(N)``, ``Y = range(M)``. - Z : (M, N) array-like - The height values over which the contour is drawn. + *X* and *Y* are x-y coordinates, specified as 2D arrays of the same + size as *Z*. `numpy.meshgrid` function could be used to create *X* + and *Y* coordinate matrices from coordinate vectors. + If ``size(Z) == [N, N]`` the *X* and *Y* matrices could be + specified as 1D arrays, where ``len(X) == len(Y) == N`` + Z : array-like, + *Z* is a 2D array that specifies the height values at each x-y + coordinate over which the contour is drawn. Z must have at least + two rows and two columns. extend3d : bool, default: False Whether to extend contour in 3D. stride : int From 8d1edba7991542986bdc15b4ec79696cb6d46a98 Mon Sep 17 00:00:00 2001 From: kislovskiy Date: Sat, 9 Oct 2021 21:34:49 +0200 Subject: [PATCH 3/3] add references to axes methods --- lib/mpl_toolkits/mplot3d/axes3d.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py index 4742540fe524..25d9e9fde457 100644 --- a/lib/mpl_toolkits/mplot3d/axes3d.py +++ b/lib/mpl_toolkits/mplot3d/axes3d.py @@ -2103,16 +2103,9 @@ def contour(self, X, Y, Z, *args, Parameters ---------- - X, Y : array-like, - *X* and *Y* are x-y coordinates, specified as 2D arrays of the same - size as *Z*. `numpy.meshgrid` function could be used to create *X* - and *Y* coordinate matrices from coordinate vectors. - If ``size(Z) == [N, N]`` the *X* and *Y* matrices could be - specified as 1D arrays, where ``len(X) == len(Y) == N`` - Z : array-like, - *Z* is a 2D array that specifies the height values at each x-y - coordinate over which the contour is drawn. Z must have at least - two rows and two columns. + X, Y, Z : array-like, + Input data. See `~matplotlib.axes.Axes.contour` for acceptable + data shapes. extend3d : bool, default: False Whether to extend contour in 3D. stride : int @@ -2156,7 +2149,8 @@ def tricontour(self, *args, Parameters ---------- X, Y, Z : array-like - Input data. + Input data. See `~matplotlib.axes.Axes.tricontour` for acceptable + data shapes. extend3d : bool, default: False Whether to extend contour in 3D. stride : int @@ -2214,7 +2208,8 @@ def contourf(self, X, Y, Z, *args, zdir='z', offset=None, **kwargs): Parameters ---------- X, Y, Z : array-like - Input data. + Input data. See `~matplotlib.axes.Axes.contourf` for acceptable + data shapes. zdir : {'x', 'y', 'z'}, default: 'z' The direction to use. offset : float, optional @@ -2252,7 +2247,8 @@ def tricontourf(self, *args, zdir='z', offset=None, **kwargs): Parameters ---------- X, Y, Z : array-like - Input data. + Input data. See `~matplotlib.axes.Axes.tricontourf` for acceptable + data shapes. zdir : {'x', 'y', 'z'}, default: 'z' The direction to use. offset : float, optional @@ -2333,7 +2329,7 @@ def scatter(self, xs, ys, zs=0, zdir='z', s=20, c=None, depthshade=True, Parameters ---------- xs, ys : array-like - The data positions. + The data positions. zs : float or array-like, default: 0 The z-positions. Either an array of the same length as *xs* and *ys* or a single value to place all points in the same plane.