Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9327a48

Browse files
authored
Merge pull request #23933 from meeseeksmachine/auto-backport-of-pr-23932-on-v3.6.x
Backport PR #23932 on branch v3.6.x (DOC: Fix formatting in image tutorial)
2 parents 502aae0 + 723b4e3 commit 9327a48

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

tutorials/introductory/images.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
interface maintains global state, and is very useful for quickly and easily
4242
experimenting with various plot settings. The alternative is the explicit,
4343
which is more suitable for large application development. For an explanation
44-
of the tradeoffs between the implicit and explicit interfaces See
44+
of the tradeoffs between the implicit and explicit interfaces see
4545
:ref:`api_interfaces` and the :doc:`Quick start guide
4646
</tutorials/introductory/quick_start>` to start using the explicit interface.
4747
For now, let's get on with the implicit approach:
@@ -91,7 +91,7 @@
9191
#
9292
# Each inner list represents a pixel. Here, with an RGB image, there
9393
# are 3 values. Since it's a black and white image, R, G, and B are all
94-
# similar. An RGBA (where A is alpha, or transparency), has 4 values
94+
# similar. An RGBA (where A is alpha, or transparency) has 4 values
9595
# per inner list, and a simple luminance image just has one value (and
9696
# is thus only a 2-D array, not a 3-D array). For RGB and RGBA images,
9797
# Matplotlib supports float32 and uint8 data types. For grayscale,
@@ -127,13 +127,11 @@
127127
# Pseudocolor is only relevant to single-channel, grayscale, luminosity
128128
# images. We currently have an RGB image. Since R, G, and B are all
129129
# similar (see for yourself above or in your data), we can just pick one
130-
# channel of our data:
130+
# channel of our data using array slicing (you can read more in the
131+
# `Numpy tutorial <https://numpy.org/doc/stable/user/quickstart.html
132+
# #indexing-slicing-and-iterating>`_):
131133

132134
lum_img = img[:, :, 0]
133-
134-
# This is array slicing. You can read more in the `Numpy tutorial
135-
# <https://numpy.org/doc/stable/user/quickstart.html>`_.
136-
137135
plt.imshow(lum_img)
138136

139137
###############################################################################

0 commit comments

Comments
 (0)