From 00a4dabf2a15d18a43166eaff37ed1019daeed7c Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sat, 10 Oct 2020 22:33:38 +0200 Subject: [PATCH] Consistently use 3D, 2D, 1D for dimensionality Co-authored-by: hannah Co-authored-by: Thomas A Caswell --- .../image_transparency_blend.py | 14 +++++----- .../images_contours_and_fields/pcolor_demo.py | 2 +- .../pcolormesh_levels.py | 2 +- examples/mplot3d/quiver3d.py | 2 +- examples/statistics/hexbin_demo.py | 2 +- lib/matplotlib/_cm.py | 2 +- lib/matplotlib/axes/_axes.py | 26 +++++++++---------- lib/matplotlib/axes/_base.py | 2 +- lib/matplotlib/cbook/__init__.py | 2 +- lib/matplotlib/cm.py | 2 +- lib/matplotlib/colors.py | 10 +++---- lib/matplotlib/contour.py | 2 +- lib/matplotlib/figure.py | 2 +- lib/matplotlib/image.py | 2 +- lib/matplotlib/mlab.py | 4 +-- lib/matplotlib/path.py | 2 +- lib/matplotlib/stackplot.py | 12 ++++----- lib/matplotlib/transforms.py | 2 +- lib/matplotlib/tri/triangulation.py | 2 +- lib/matplotlib/tri/triinterpolate.py | 6 ++--- lib/matplotlib/tri/trirefine.py | 4 +-- lib/matplotlib/tri/tritools.py | 2 +- lib/mpl_toolkits/axisartist/axislines.py | 4 +-- lib/mpl_toolkits/mplot3d/axes3d.py | 10 +++---- lib/mpl_toolkits/tests/test_mplot3d.py | 6 ++--- tutorials/introductory/sample_plots.py | 2 +- 26 files changed, 64 insertions(+), 64 deletions(-) diff --git a/examples/images_contours_and_fields/image_transparency_blend.py b/examples/images_contours_and_fields/image_transparency_blend.py index 8e47dca5af4e..7de2b42fedde 100644 --- a/examples/images_contours_and_fields/image_transparency_blend.py +++ b/examples/images_contours_and_fields/image_transparency_blend.py @@ -1,18 +1,18 @@ """ -=========================================== -Blend transparency with color in 2-D images -=========================================== +========================================== +Blend transparency with color in 2D images +========================================== Blend transparency with color to highlight parts of data with imshow. -A common use for `matplotlib.pyplot.imshow` is to plot a 2-D statistical -map. The function makes it easy to visualize a 2-D matrix as an image and add +A common use for `matplotlib.pyplot.imshow` is to plot a 2D statistical +map. The function makes it easy to visualize a 2D matrix as an image and add transparency to the output. For example, one can plot a statistic (such as a t-statistic) and color the transparency of each pixel according to its p-value. This example demonstrates how you can achieve this effect. -First we will generate some data, in this case, we'll create two 2-D "blobs" -in a 2-D grid. One blob will be positive, and the other negative. +First we will generate some data, in this case, we'll create two 2D "blobs" +in a 2D grid. One blob will be positive, and the other negative. """ # sphinx_gallery_thumbnail_number = 3 diff --git a/examples/images_contours_and_fields/pcolor_demo.py b/examples/images_contours_and_fields/pcolor_demo.py index bc9c8f6c5247..4862bb583288 100644 --- a/examples/images_contours_and_fields/pcolor_demo.py +++ b/examples/images_contours_and_fields/pcolor_demo.py @@ -5,7 +5,7 @@ Generating images with `~.axes.Axes.pcolor`. -Pcolor allows you to generate 2-D image-style plots. Below we will show how +Pcolor allows you to generate 2D image-style plots. Below we will show how to do so in Matplotlib. """ import matplotlib.pyplot as plt diff --git a/examples/images_contours_and_fields/pcolormesh_levels.py b/examples/images_contours_and_fields/pcolormesh_levels.py index 1bec248a9936..e8768beb81c5 100644 --- a/examples/images_contours_and_fields/pcolormesh_levels.py +++ b/examples/images_contours_and_fields/pcolormesh_levels.py @@ -3,7 +3,7 @@ pcolormesh ========== -`.axes.Axes.pcolormesh` allows you to generate 2-D image-style plots. Note it +`.axes.Axes.pcolormesh` allows you to generate 2D image-style plots. Note it is faster than the similar `~.axes.Axes.pcolor`. """ diff --git a/examples/mplot3d/quiver3d.py b/examples/mplot3d/quiver3d.py index 12d60ee93e62..1eba869c83b8 100644 --- a/examples/mplot3d/quiver3d.py +++ b/examples/mplot3d/quiver3d.py @@ -3,7 +3,7 @@ 3D quiver plot ============== -Demonstrates plotting directional arrows at points on a 3d meshgrid. +Demonstrates plotting directional arrows at points on a 3D meshgrid. """ import matplotlib.pyplot as plt diff --git a/examples/statistics/hexbin_demo.py b/examples/statistics/hexbin_demo.py index 8115f99548ea..5ebc5d1c4b6d 100644 --- a/examples/statistics/hexbin_demo.py +++ b/examples/statistics/hexbin_demo.py @@ -6,7 +6,7 @@ Plotting hexbins with Matplotlib. Hexbin is an axes method or pyplot function that is essentially -a pcolor of a 2-D histogram with hexagonal cells. It can be +a pcolor of a 2D histogram with hexagonal cells. It can be much more informative than a scatter plot. In the first plot below, try substituting 'scatter' for 'hexbin'. """ diff --git a/lib/matplotlib/_cm.py b/lib/matplotlib/_cm.py index a04cb69d3e7d..84b2fd3799f2 100644 --- a/lib/matplotlib/_cm.py +++ b/lib/matplotlib/_cm.py @@ -76,7 +76,7 @@ def cubehelix(gamma=1.0, s=0.5, r=-1.5, h=1.0): can be visualised as a squashed helix around the diagonal in the (r, g, b) color cube. - For a unit color cube (i.e. 3-D coordinates for (r, g, b) each in the + For a unit color cube (i.e. 3D coordinates for (r, g, b) each in the range 0 to 1) the color scheme starts at (r, g, b) = (0, 0, 0), i.e. black, and finishes at (r, g, b) = (1, 1, 1), i.e. white. For some fraction *x*, between 0 and 1, the color is the corresponding grey value at that diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 36f9d73aa14d..5066b088c16a 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2028,11 +2028,11 @@ def step(self, x, y, *args, where='pre', data=None, **kwargs): Parameters ---------- x : array-like - 1-D sequence of x positions. It is assumed, but not checked, that + 1D sequence of x positions. It is assumed, but not checked, that it is uniformly increasing. y : array-like - 1-D sequence of y levels. + 1D sequence of y levels. fmt : str, optional A format string, e.g. 'g' for a green line. See `.plot` for a more @@ -4200,7 +4200,7 @@ def invalid_shape_exception(csize, xsize): "RGBA sequence, which should be avoided as value-" "mapping will have precedence in case its length " "matches with *x* & *y*. Please use the *color* " - "keyword-argument or provide a 2-D array " + "keyword-argument or provide a 2D array " "with a single row if you intend to specify " "the same RGB or RGBA value for all points.") valid_shape = False @@ -4253,14 +4253,14 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, - A scalar or sequence of n numbers to be mapped to colors using *cmap* and *norm*. - - A 2-D array in which the rows are RGB or RGBA. + - A 2D array in which the rows are RGB or RGBA. - A sequence of colors of length n. - A single color format string. Note that *c* should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. If you want to specify the same RGB or RGBA value for - all points, use a 2-D array with a single row. Otherwise, value- + all points, use a 2D array with a single row. Otherwise, value- matching will have precedence in case of a size matching with *x* and *y*. @@ -4341,7 +4341,7 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, case all masks will be combined and only unmasked points will be plotted. - * Fundamentally, scatter works with 1-D arrays; *x*, *y*, *s*, and *c* + * Fundamentally, scatter works with 1D arrays; *x*, *y*, *s*, and *c* may be input as N-D arrays, but within scatter they will be flattened. The exception is *c*, which will be flattened only if its size matches the size of *x* and *y*. @@ -5597,7 +5597,7 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None, Parameters ---------- C : array-like - A scalar 2-D array. The values will be color-mapped. + A scalar 2D array. The values will be color-mapped. X, Y : array-like, optional The coordinates of the corners of quadrilaterals of a pcolormesh:: @@ -5623,7 +5623,7 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None, color ``C[i, j]`` will be centered on ``(X[i, j], Y[i, j])``. If *X* and/or *Y* are 1-D arrays or column vectors they will be - expanded as needed into the appropriate 2-D arrays, making a + expanded as needed into the appropriate 2D arrays, making a rectangular grid. shading : {'flat', 'nearest', 'auto'}, optional @@ -5841,7 +5841,7 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None, Parameters ---------- C : array-like - A scalar 2-D array. The values will be color-mapped. + A scalar 2D array. The values will be color-mapped. X, Y : array-like, optional The coordinates of the corners of quadrilaterals of a pcolormesh:: @@ -5869,7 +5869,7 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None, interpolation is caried out between the quadrilateral corners. If *X* and/or *Y* are 1-D arrays or column vectors they will be - expanded as needed into the appropriate 2-D arrays, making a + expanded as needed into the appropriate 2D arrays, making a rectangular grid. cmap : str or `~matplotlib.colors.Colormap`, default: :rc:`image.cmap` @@ -5970,7 +5970,7 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None, **Differences between pcolor() and pcolormesh()** - Both methods are used to create a pseudocolor plot of a 2-D array + Both methods are used to create a pseudocolor plot of a 2D array using quadrilaterals. The main difference lies in the created object and internal data @@ -6300,7 +6300,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None, Multiple data can be provided via *x* as a list of datasets of potentially different length ([*x0*, *x1*, ...]), or as - a 2-D ndarray in which each column is a dataset. Note that + a 2D ndarray in which each column is a dataset. Note that the ndarray form is transposed relative to the list form. Masked arrays are not supported. @@ -7478,7 +7478,7 @@ def specgram(self, x, NFFT=None, Fs=None, Fc=None, detrend=None, Returns ------- - spectrum : 2-D array + spectrum : 2D array Columns are the periodograms of successive segments. freqs : 1-D array diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index bab3170475ae..26bc28dea71a 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -430,7 +430,7 @@ def _plot_args(self, tup, kwargs, return_kwargs=False): raise ValueError(f"x and y must have same first dimension, but " f"have shapes {x.shape} and {y.shape}") if x.ndim > 2 or y.ndim > 2: - raise ValueError(f"x and y can be no greater than 2-D, but have " + raise ValueError(f"x and y can be no greater than 2D, but have " f"shapes {x.shape} and {y.shape}") if x.ndim == 1: x = x[:, np.newaxis] diff --git a/lib/matplotlib/cbook/__init__.py b/lib/matplotlib/cbook/__init__.py index af718e48133d..b34c98f66b0f 100644 --- a/lib/matplotlib/cbook/__init__.py +++ b/lib/matplotlib/cbook/__init__.py @@ -1300,7 +1300,7 @@ def _to_unmasked_float_array(x): def _check_1d(x): - """Convert scalars to 1d arrays; pass-through arrays as is.""" + """Convert scalars to 1D arrays; pass-through arrays as is.""" if not hasattr(x, 'shape') or len(x.shape) < 1: return np.atleast_1d(x) else: diff --git a/lib/matplotlib/cm.py b/lib/matplotlib/cm.py index d4a8b1df5cb2..e87dd728440d 100644 --- a/lib/matplotlib/cm.py +++ b/lib/matplotlib/cm.py @@ -295,7 +295,7 @@ def to_rgba(self, x, alpha=None, bytes=False, norm=True): """ Return a normalized rgba array corresponding to *x*. - In the normal case, *x* is a 1-D or 2-D sequence of scalars, and + In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable. diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index 17777a63642a..3678c2b16fa7 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -415,7 +415,7 @@ class ColorConverter: def _create_lookup_table(N, data, gamma=1.0): r""" - Create an *N* -element 1-d lookup table. + Create an *N* -element 1D lookup table. This assumes a mapping :math:`f : [0, 1] \rightarrow [0, 1]`. The returned data is an array of N values :math:`y = f(x)` where x is sampled from @@ -1795,7 +1795,7 @@ def hillshade(self, elevation, vert_exag=1, dx=1, dy=1, fraction=1.): Parameters ---------- elevation : array-like - A 2d array (or equivalent) of the height values used to generate an + A 2D array (or equivalent) of the height values used to generate an illumination map vert_exag : number, optional The amount to exaggerate the elevation values by when calculating @@ -1817,7 +1817,7 @@ def hillshade(self, elevation, vert_exag=1, dx=1, dy=1, fraction=1.): Returns ------- ndarray - A 2d array of illumination values between 0-1, where 0 is + A 2D array of illumination values between 0-1, where 0 is completely in shadow and 1 is completely illuminated. """ @@ -1860,7 +1860,7 @@ def shade_normals(self, normals, fraction=1.): Returns ------- ndarray - A 2d array of illumination values between 0-1, where 0 is + A 2D array of illumination values between 0-1, where 0 is completely in shadow and 1 is completely illuminated. """ @@ -1893,7 +1893,7 @@ def shade(self, data, cmap, norm=None, blend_mode='overlay', vmin=None, Parameters ---------- data : array-like - A 2d array (or equivalent) of the height values used to generate a + A 2D array (or equivalent) of the height values used to generate a shaded map. cmap : `~matplotlib.colors.Colormap` The colormap used to color the *data* array. Note that this must be diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index ab0bda750cdd..a7b86f91b9c7 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -1564,7 +1564,7 @@ def _initialize_x_y(self, z): X, Y : array-like, optional The coordinates of the values in *Z*. - *X* and *Y* must both be 2-D with the same shape as *Z* (e.g. + *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) == M`` is the number of columns in *Z* and ``len(Y) == N`` is the number of rows in *Z*. diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index 2e3d9a3100d0..44e57389cdbb 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -3229,7 +3229,7 @@ def figaspect(arg): Parameters ---------- - arg : float or 2d array + arg : float or 2D array If a float, this defines the aspect ratio (i.e. the ratio height / width). In case of an array the aspect ratio is number of rows / number of diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index beeb3543bb9c..40c30fa33db9 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -76,7 +76,7 @@ def composite_images(images, renderer, magnification=1.0): Returns ------- - image : uint8 3d array + image : uint8 array (M, N, 4) The composited RGBA image. offset_x, offset_y : float The (left, bottom) offset where the composited image should be placed diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index 41172228e8ac..ff2a9b023f6c 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -739,7 +739,7 @@ def specgram(x, NFFT=None, Fs=None, detrend=None, window=None, Returns ------- spectrum : array-like - 2-D array, columns are the periodograms of successive segments. + 2D array, columns are the periodograms of successive segments. freqs : array-like 1-D array, frequencies corresponding to the rows in *spectrum*. @@ -841,7 +841,7 @@ class GaussianKDE: ---------- dataset : array-like Datapoints to estimate from. In case of univariate data this is a 1-D - array, otherwise a 2-D array with shape (# of dims, # of data). + array, otherwise a 2D array with shape (# of dims, # of data). bw_method : str, scalar or callable, optional The method used to calculate the estimator bandwidth. This can be diff --git a/lib/matplotlib/path.py b/lib/matplotlib/path.py index bc65a5d6fe27..a9a220479759 100644 --- a/lib/matplotlib/path.py +++ b/lib/matplotlib/path.py @@ -216,7 +216,7 @@ def vertices(self, vertices): @property def codes(self): """ - The list of codes in the `Path` as a 1-D numpy array. Each + The list of codes in the `Path` as a 1D numpy array. Each code is one of `STOP`, `MOVETO`, `LINETO`, `CURVE3`, `CURVE4` or `CLOSEPOLY`. For codes that correspond to more than one vertex (`CURVE3` and `CURVE4`), that code will be repeated so diff --git a/lib/matplotlib/stackplot.py b/lib/matplotlib/stackplot.py index 20b401aab38c..9d476d7cf8e3 100644 --- a/lib/matplotlib/stackplot.py +++ b/lib/matplotlib/stackplot.py @@ -21,15 +21,15 @@ def stackplot(axes, x, *args, Parameters ---------- - x : 1d array of dimension N + x : array-like (N) - y : 2d array (dimension MxN), or sequence of 1d arrays (each dimension 1xN) + y : 2D array (M, N) or sequence of array-like (N) The data is assumed to be unstacked. Each of the following calls is legal:: - stackplot(x, y) # where y is MxN - stackplot(x, y1, y2, y3, y4) # where y1, y2, y3, y4, are all 1xNm + stackplot(x, y) # where y has shape (M, N) + stackplot(x, y1, y2, y3) # where y1, y2, y3, y4 have length N baseline : {'zero', 'sym', 'wiggle', 'weighted_wiggle'} Method used to calculate the baseline: @@ -42,10 +42,10 @@ def stackplot(axes, x, *args, size of each layer. It is also called 'Streamgraph'-layout. More details can be found at http://leebyron.com/streamgraph/. - labels : Length N sequence of strings + labels : Length N list of str Labels to assign to each data series. - colors : Length N sequence of colors + colors : Length N list of color A list or tuple of colors. These will be cycled through and used to colour the stacked areas. diff --git a/lib/matplotlib/transforms.py b/lib/matplotlib/transforms.py index 87ae0eac75c5..ba29e6719740 100644 --- a/lib/matplotlib/transforms.py +++ b/lib/matplotlib/transforms.py @@ -1213,7 +1213,7 @@ class Transform(TransformNode): The following attributes may be overridden if the default is unsuitable: - - :attr:`is_separable` (defaults to True for 1d -> 1d transforms, False + - :attr:`is_separable` (defaults to True for 1D -> 1D transforms, False otherwise) - :attr:`has_inverse` (defaults to True if :meth:`inverted` is overridden, False otherwise) diff --git a/lib/matplotlib/tri/triangulation.py b/lib/matplotlib/tri/triangulation.py index 4331efc54024..8d61c19e2499 100644 --- a/lib/matplotlib/tri/triangulation.py +++ b/lib/matplotlib/tri/triangulation.py @@ -41,7 +41,7 @@ def __init__(self, x, y, triangles=None, mask=None): self.x = np.asarray(x, dtype=np.float64) self.y = np.asarray(y, dtype=np.float64) if self.x.shape != self.y.shape or self.x.ndim != 1: - raise ValueError("x and y must be equal-length 1-D arrays") + raise ValueError("x and y must be equal-length 1D arrays") self.mask = None self._edges = None diff --git a/lib/matplotlib/tri/triinterpolate.py b/lib/matplotlib/tri/triinterpolate.py index 066affdba97c..5e6a2ab11888 100644 --- a/lib/matplotlib/tri/triinterpolate.py +++ b/lib/matplotlib/tri/triinterpolate.py @@ -215,9 +215,9 @@ def _interpolate_single_key(self, return_key, tri_index, x, y): ---------- return_index : {'z', 'dzdx', 'dzdy'} Identifies the requested values (z or its derivatives) - tri_index : 1d int array + tri_index : 1D int array Valid triangle index (-1 prohibited) - x, y : 1d arrays, same shape as `tri_index` + x, y : 1D arrays, same shape as `tri_index` Valid locations where interpolation is requested. Returns @@ -290,7 +290,7 @@ class CubicTriInterpolator(TriInterpolator): In one-dimension - on a segment - a cubic interpolating function is defined by the values of the function and its derivative at both ends. - This is almost the same in 2-d inside a triangle, except that the values + This is almost the same in 2D inside a triangle, except that the values of the function and its 2 derivatives have to be defined at each triangle node. diff --git a/lib/matplotlib/tri/trirefine.py b/lib/matplotlib/tri/trirefine.py index 98afe18e6615..b253dbaaca8e 100644 --- a/lib/matplotlib/tri/trirefine.py +++ b/lib/matplotlib/tri/trirefine.py @@ -136,7 +136,7 @@ def refine_field(self, z, triinterpolator=None, subdiv=3): Parameters ---------- - z : 1d-array-like of length ``n_points`` + z : array-like of length ``n_points`` Values of the field to refine, defined at the nodes of the encapsulated triangulation. (``n_points`` is the number of points in the initial triangulation) @@ -151,7 +151,7 @@ def refine_field(self, z, triinterpolator=None, subdiv=3): ------- refi_tri : `~matplotlib.tri.Triangulation` The returned refined triangulation. - refi_z : 1d array of length: *refi_tri* node count. + refi_z : 1D array of length: *refi_tri* node count. The returned interpolated field (at *refi_tri* nodes). """ if triinterpolator is None: diff --git a/lib/matplotlib/tri/tritools.py b/lib/matplotlib/tri/tritools.py index ddcf7d3e92f7..90a9db8461a5 100644 --- a/lib/matplotlib/tri/tritools.py +++ b/lib/matplotlib/tri/tritools.py @@ -243,7 +243,7 @@ def _total_to_compress_renum(valid): """ Parameters ---------- - valid : 1d bool array + valid : 1D bool array Validity mask. Returns diff --git a/lib/mpl_toolkits/axisartist/axislines.py b/lib/mpl_toolkits/axisartist/axislines.py index 3e2dca2c573b..380bf9285a51 100644 --- a/lib/mpl_toolkits/axisartist/axislines.py +++ b/lib/mpl_toolkits/axisartist/axislines.py @@ -115,7 +115,7 @@ class Fixed(_Base): def __init__(self, loc, nth_coord=None): """ nth_coord = along which coordinate value varies - in 2d, nth_coord = 0 -> x axis, nth_coord = 1 -> y axis + in 2D, nth_coord = 0 -> x axis, nth_coord = 1 -> y axis """ _api.check_in_list(["left", "right", "bottom", "top"], loc=loc) self._loc = loc @@ -195,7 +195,7 @@ class Fixed(AxisArtistHelper.Fixed): def __init__(self, axes, loc, nth_coord=None): """ nth_coord = along which coordinate value varies - in 2d, nth_coord = 0 -> x axis, nth_coord = 1 -> y axis + in 2D, nth_coord = 0 -> x axis, nth_coord = 1 -> y axis """ super().__init__(loc, nth_coord) self.axis = [axes.xaxis, axes.yaxis][self.nth_coord] diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py index 68b35390feae..0a8f7fbc9f72 100644 --- a/lib/mpl_toolkits/mplot3d/axes3d.py +++ b/lib/mpl_toolkits/mplot3d/axes3d.py @@ -946,7 +946,7 @@ def set_zscale(self, value, **kwargs): Notes ----- - This function is merely provided for completeness, but 3d axes do not + This function is merely provided for completeness, but 3D axes do not support dates for ticks, and so this may not work as expected. """) @@ -1495,7 +1495,7 @@ def plot_surface(self, X, Y, Z, *args, norm=None, vmin=None, Parameters ---------- - X, Y, Z : 2d arrays + X, Y, Z : 2D arrays Data values. rcount, ccount : int @@ -1751,7 +1751,7 @@ def plot_wireframe(self, X, Y, Z, *args, **kwargs): Parameters ---------- - X, Y, Z : 2d arrays + X, Y, Z : 2D arrays Data values. rcount, ccount : int @@ -2272,7 +2272,7 @@ def scatter(self, xs, ys, zs=0, zdir='z', s=20, c=None, depthshade=True, - A sequence of colors of length n. - A sequence of n numbers to be mapped to colors using *cmap* and *norm*. - - A 2-D array in which the rows are RGB or RGBA. + - A 2D array in which the rows are RGB or RGBA. For more details see the *c* argument of `~.axes.Axes.scatter`. depthshade : bool, default: True @@ -2699,7 +2699,7 @@ def voxels(self, *args, facecolors=None, edgecolors=None, shade=True, Parameters ---------- filled : 3D np.array of bool - A 3d array of values, with truthy values indicating which voxels + A 3D array of values, with truthy values indicating which voxels to fill x, y, z : 3D np.array, optional diff --git a/lib/mpl_toolkits/tests/test_mplot3d.py b/lib/mpl_toolkits/tests/test_mplot3d.py index efda55ce05e1..6563b3df0f18 100644 --- a/lib/mpl_toolkits/tests/test_mplot3d.py +++ b/lib/mpl_toolkits/tests/test_mplot3d.py @@ -941,7 +941,7 @@ def test_edge_style(self): @mpl3d_image_comparison(['voxels-named-colors.png']) def test_named_colors(self): - """Test with colors set to a 3d object array of strings.""" + """Test with colors set to a 3D object array of strings.""" fig, ax = plt.subplots(subplot_kw={"projection": "3d"}) x, y, z = np.indices((10, 10, 10)) @@ -1171,7 +1171,7 @@ def test_minor_ticks(): @mpl3d_image_comparison(['errorbar3d_errorevery.png']) def test_errorbar3d_errorevery(): - """Tests errorevery functionality for 3d errorbars.""" + """Tests errorevery functionality for 3D errorbars.""" t = np.arange(0, 2*np.pi+.1, 0.01) x, y, z = np.sin(t), np.cos(3*t), np.sin(5*t) @@ -1189,7 +1189,7 @@ def test_errorbar3d_errorevery(): @mpl3d_image_comparison(['errorbar3d.png']) def test_errorbar3d(): - """Tests limits, color styling, and legend for 3d errorbars.""" + """Tests limits, color styling, and legend for 3D errorbars.""" fig = plt.figure() ax = fig.add_subplot(projection='3d') diff --git a/tutorials/introductory/sample_plots.py b/tutorials/introductory/sample_plots.py index c6a10d9ff057..6eb01308ae45 100644 --- a/tutorials/introductory/sample_plots.py +++ b/tutorials/introductory/sample_plots.py @@ -107,7 +107,7 @@ ========================== The mplot3d toolkit (see :ref:`toolkit_mplot3d-tutorial` and -:ref:`mplot3d-examples-index`) has support for simple 3d graphs +:ref:`mplot3d-examples-index`) has support for simple 3D graphs including surface, wireframe, scatter, and bar charts. .. figure:: ../../gallery/mplot3d/images/sphx_glr_surface3d_001.png