Skip to content

Commit 430041f

Browse files
authored
Merge pull request #20533 from timhoffm/doc-contour-MN
Rename (N, M) -> (M, N) array-like
2 parents 189dba3 + 4f767f4 commit 430041f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

examples/images_contours_and_fields/image_annotated_heatmap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ def heatmap(data, row_labels, col_labels, ax=None,
107107
Parameters
108108
----------
109109
data
110-
A 2D numpy array of shape (N, M).
110+
A 2D numpy array of shape (M, N).
111111
row_labels
112-
A list or array of length N with the labels for the rows.
112+
A list or array of length M with the labels for the rows.
113113
col_labels
114-
A list or array of length M with the labels for the columns.
114+
A list or array of length N with the labels for the columns.
115115
ax
116116
A `matplotlib.axes.Axes` instance to which the heatmap is plotted. If
117117
not provided, use current axes or create a new one. Optional.

examples/lines_bars_and_markers/filled_step.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def stack_hist(ax, stacked_data, sty_cycle, bottoms=None,
8686
The axes to add artists too
8787
8888
stacked_data : array or Mapping
89-
A (N, M) shaped array. The first dimension will be iterated over to
89+
A (M, N) shaped array. The first dimension will be iterated over to
9090
compute histograms row-wise
9191
9292
sty_cycle : Cycler or operable of dict

lib/matplotlib/contour.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,13 +1577,13 @@ def _initialize_x_y(self, z):
15771577
15781578
*X* and *Y* must both be 2D with the same shape as *Z* (e.g.
15791579
created via `numpy.meshgrid`), or they must both be 1-D such
1580-
that ``len(X) == M`` is the number of columns in *Z* and
1581-
``len(Y) == N`` is the number of rows in *Z*.
1580+
that ``len(X) == N`` is the number of columns in *Z* and
1581+
``len(Y) == M`` is the number of rows in *Z*.
15821582
15831583
If not given, they are assumed to be integer indices, i.e.
1584-
``X = range(M)``, ``Y = range(N)``.
1584+
``X = range(N)``, ``Y = range(M)``.
15851585
1586-
Z : (N, M) array-like
1586+
Z : (M, N) array-like
15871587
The height values over which the contour is drawn.
15881588
15891589
levels : int or array-like, optional

0 commit comments

Comments
 (0)