Skip to content

Commit 709bdc0

Browse files
committed
Consistently use 3D, 2D, 1D for dimensionality
1 parent 4b244a7 commit 709bdc0

File tree

25 files changed

+63
-63
lines changed

25 files changed

+63
-63
lines changed

examples/images_contours_and_fields/image_transparency_blend.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
"""
2-
===========================================
3-
Blend transparency with color in 2-D images
4-
===========================================
2+
==========================================
3+
Blend transparency with color in 2D images
4+
==========================================
55
66
Blend transparency with color to highlight parts of data with imshow.
77
8-
A common use for `matplotlib.pyplot.imshow` is to plot a 2-D statistical
9-
map. The function makes it easy to visualize a 2-D matrix as an image and add
8+
A common use for `matplotlib.pyplot.imshow` is to plot a 2D statistical
9+
map. The function makes it easy to visualize a 2D matrix as an image and add
1010
transparency to the output. For example, one can plot a statistic (such as a
1111
t-statistic) and color the transparency of each pixel according to its p-value.
1212
This example demonstrates how you can achieve this effect.
1313
14-
First we will generate some data, in this case, we'll create two 2-D "blobs"
15-
in a 2-D grid. One blob will be positive, and the other negative.
14+
First we will generate some data, in this case, we'll create two 2D "blobs"
15+
in a 2D grid. One blob will be positive, and the other negative.
1616
"""
1717

1818
# sphinx_gallery_thumbnail_number = 3

examples/images_contours_and_fields/pcolor_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Generating images with `~.axes.Axes.pcolor`.
77
8-
Pcolor allows you to generate 2-D image-style plots. Below we will show how
8+
Pcolor allows you to generate 2D image-style plots. Below we will show how
99
to do so in Matplotlib.
1010
"""
1111
import matplotlib.pyplot as plt

examples/images_contours_and_fields/pcolormesh_levels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pcolormesh
44
==========
55
6-
`.axes.Axes.pcolormesh` allows you to generate 2-D image-style plots. Note it
6+
`.axes.Axes.pcolormesh` allows you to generate 2D image-style plots. Note it
77
is faster than the similar `~.axes.Axes.pcolor`.
88
99
"""

examples/mplot3d/quiver3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
3D quiver plot
44
==============
55
6-
Demonstrates plotting directional arrows at points on a 3d meshgrid.
6+
Demonstrates plotting directional arrows at points on a 3D meshgrid.
77
"""
88

99
import matplotlib.pyplot as plt

examples/statistics/hexbin_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Plotting hexbins with Matplotlib.
77
88
Hexbin is an axes method or pyplot function that is essentially
9-
a pcolor of a 2-D histogram with hexagonal cells. It can be
9+
a pcolor of a 2D histogram with hexagonal cells. It can be
1010
much more informative than a scatter plot. In the first plot
1111
below, try substituting 'scatter' for 'hexbin'.
1212
"""

lib/matplotlib/_cm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def cubehelix(gamma=1.0, s=0.5, r=-1.5, h=1.0):
7676
can be visualised as a squashed helix around the diagonal in the
7777
(r, g, b) color cube.
7878
79-
For a unit color cube (i.e. 3-D coordinates for (r, g, b) each in the
79+
For a unit color cube (i.e. 3D coordinates for (r, g, b) each in the
8080
range 0 to 1) the color scheme starts at (r, g, b) = (0, 0, 0), i.e. black,
8181
and finishes at (r, g, b) = (1, 1, 1), i.e. white. For some fraction *x*,
8282
between 0 and 1, the color is the corresponding grey value at that

lib/matplotlib/axes/_axes.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,7 @@ def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):
14141414
>>> plot(x1, y1, 'bo')
14151415
>>> plot(x2, y2, 'go')
14161416
1417-
- Alternatively, if your data is already a 2d array, you can pass it
1417+
- Alternatively, if your data is already a 2D array, you can pass it
14181418
directly to *x*, *y*. A separate data set will be drawn for every
14191419
column.
14201420
@@ -2025,11 +2025,11 @@ def step(self, x, y, *args, where='pre', data=None, **kwargs):
20252025
Parameters
20262026
----------
20272027
x : array-like
2028-
1-D sequence of x positions. It is assumed, but not checked, that
2028+
1D sequence of x positions. It is assumed, but not checked, that
20292029
it is uniformly increasing.
20302030
20312031
y : array-like
2032-
1-D sequence of y levels.
2032+
1D sequence of y levels.
20332033
20342034
fmt : str, optional
20352035
A format string, e.g. 'g' for a green line. See `.plot` for a more
@@ -4197,7 +4197,7 @@ def invalid_shape_exception(csize, xsize):
41974197
"RGBA sequence, which should be avoided as value-"
41984198
"mapping will have precedence in case its length "
41994199
"matches with *x* & *y*. Please use the *color* "
4200-
"keyword-argument or provide a 2-D array "
4200+
"keyword-argument or provide a 2D array "
42014201
"with a single row if you intend to specify "
42024202
"the same RGB or RGBA value for all points.")
42034203
valid_shape = False
@@ -4250,14 +4250,14 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
42504250
42514251
- A scalar or sequence of n numbers to be mapped to colors using
42524252
*cmap* and *norm*.
4253-
- A 2-D array in which the rows are RGB or RGBA.
4253+
- A 2D array in which the rows are RGB or RGBA.
42544254
- A sequence of colors of length n.
42554255
- A single color format string.
42564256
42574257
Note that *c* should not be a single numeric RGB or RGBA sequence
42584258
because that is indistinguishable from an array of values to be
42594259
colormapped. If you want to specify the same RGB or RGBA value for
4260-
all points, use a 2-D array with a single row. Otherwise, value-
4260+
all points, use a 2D array with a single row. Otherwise, value-
42614261
matching will have precedence in case of a size matching with *x*
42624262
and *y*.
42634263
@@ -4338,7 +4338,7 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
43384338
case all masks will be combined and only unmasked points will be
43394339
plotted.
43404340
4341-
* Fundamentally, scatter works with 1-D arrays; *x*, *y*, *s*, and *c*
4341+
* Fundamentally, scatter works with 1D arrays; *x*, *y*, *s*, and *c*
43424342
may be input as N-D arrays, but within scatter they will be
43434343
flattened. The exception is *c*, which will be flattened only if its
43444344
size matches the size of *x* and *y*.
@@ -5594,7 +5594,7 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
55945594
Parameters
55955595
----------
55965596
C : array-like
5597-
A scalar 2-D array. The values will be color-mapped.
5597+
A scalar 2D array. The values will be color-mapped.
55985598
55995599
X, Y : array-like, optional
56005600
The coordinates of the corners of quadrilaterals of a pcolormesh::
@@ -5620,7 +5620,7 @@ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
56205620
color ``C[i, j]`` will be centered on ``(X[i, j], Y[i, j])``.
56215621
56225622
If *X* and/or *Y* are 1-D arrays or column vectors they will be
5623-
expanded as needed into the appropriate 2-D arrays, making a
5623+
expanded as needed into the appropriate 2D arrays, making a
56245624
rectangular grid.
56255625
56265626
shading : {'flat', 'nearest', 'auto'}, optional
@@ -5838,7 +5838,7 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
58385838
Parameters
58395839
----------
58405840
C : array-like
5841-
A scalar 2-D array. The values will be color-mapped.
5841+
A scalar 2D array. The values will be color-mapped.
58425842
58435843
X, Y : array-like, optional
58445844
The coordinates of the corners of quadrilaterals of a pcolormesh::
@@ -5866,7 +5866,7 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
58665866
interpolation is caried out between the quadrilateral corners.
58675867
58685868
If *X* and/or *Y* are 1-D arrays or column vectors they will be
5869-
expanded as needed into the appropriate 2-D arrays, making a
5869+
expanded as needed into the appropriate 2D arrays, making a
58705870
rectangular grid.
58715871
58725872
cmap : str or `~matplotlib.colors.Colormap`, default: :rc:`image.cmap`
@@ -5967,7 +5967,7 @@ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
59675967
59685968
**Differences between pcolor() and pcolormesh()**
59695969
5970-
Both methods are used to create a pseudocolor plot of a 2-D array
5970+
Both methods are used to create a pseudocolor plot of a 2D array
59715971
using quadrilaterals.
59725972
59735973
The main difference lies in the created object and internal data
@@ -6285,7 +6285,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
62856285
62866286
Multiple data can be provided via *x* as a list of datasets
62876287
of potentially different length ([*x0*, *x1*, ...]), or as
6288-
a 2-D ndarray in which each column is a dataset. Note that
6288+
a 2D ndarray in which each column is a dataset. Note that
62896289
the ndarray form is transposed relative to the list form.
62906290
62916291
Masked arrays are not supported.
@@ -7461,7 +7461,7 @@ def specgram(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
74617461
74627462
Returns
74637463
-------
7464-
spectrum : 2-D array
7464+
spectrum : 2D array
74657465
Columns are the periodograms of successive segments.
74667466
74677467
freqs : 1-D array

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ def _plot_args(self, tup, kwargs, return_kwargs=False):
430430
raise ValueError(f"x and y must have same first dimension, but "
431431
f"have shapes {x.shape} and {y.shape}")
432432
if x.ndim > 2 or y.ndim > 2:
433-
raise ValueError(f"x and y can be no greater than 2-D, but have "
433+
raise ValueError(f"x and y can be no greater than 2D, but have "
434434
f"shapes {x.shape} and {y.shape}")
435435
if x.ndim == 1:
436436
x = x[:, np.newaxis]

lib/matplotlib/cbook/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ def _to_unmasked_float_array(x):
13001300

13011301

13021302
def _check_1d(x):
1303-
"""Convert scalars to 1d arrays; pass-through arrays as is."""
1303+
"""Convert scalars to 1D arrays; pass-through arrays as is."""
13041304
if not hasattr(x, 'shape') or len(x.shape) < 1:
13051305
return np.atleast_1d(x)
13061306
else:

lib/matplotlib/cm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def to_rgba(self, x, alpha=None, bytes=False, norm=True):
295295
"""
296296
Return a normalized rgba array corresponding to *x*.
297297
298-
In the normal case, *x* is a 1-D or 2-D sequence of scalars, and
298+
In the normal case, *x* is a 1D or 2D sequence of scalars, and
299299
the corresponding ndarray of rgba values will be returned,
300300
based on the norm and colormap set for this ScalarMappable.
301301

0 commit comments

Comments
 (0)