4848# ListedColormap
4949# --------------
5050#
51- # `.ListedColormap` s store their color values in a ``.colors`` attribute.
51+ # `.ListedColormap`\ s store their color values in a ``.colors`` attribute.
5252# The list of colors that comprise the colormap can be directly accessed using
5353# the ``colors`` property,
5454# or it can be accessed indirectly by calling ``viridis`` with an array
6868##############################################################################
6969# LinearSegmentedColormap
7070# -----------------------
71- # `.LinearSegmentedColormap` s do not have a ``.colors`` attribute.
71+ # `.LinearSegmentedColormap`\ s do not have a ``.colors`` attribute.
7272# However, one may still call the colormap with an integer array, or with a
7373# float array between 0 and 1.
7474
@@ -114,7 +114,7 @@ def plot_examples(colormaps):
114114
115115##############################################################################
116116# In fact, that list may contain any valid
117- # :doc:`matplotlib color specification </tutorials/colors/colors>`.
117+ # :doc:`Matplotlib color specification </tutorials/colors/colors>`.
118118# Particularly useful for creating custom colormaps are Nx4 numpy arrays.
119119# Because with the variety of numpy operations that we can do on a such an
120120# array, carpentry of new colormaps from existing colormaps become quite
@@ -168,7 +168,7 @@ def plot_examples(colormaps):
168168# Creating linear segmented colormaps
169169# ===================================
170170#
171- # `.LinearSegmentedColormap` class specifies colormaps using anchor points
171+ # The `.LinearSegmentedColormap` class specifies colormaps using anchor points
172172# between which RGB(A) values are interpolated.
173173#
174174# The format to specify these colormaps allows discontinuities at the anchor
@@ -177,7 +177,7 @@ def plot_examples(colormaps):
177177# ``yleft[i]`` and ``yright[i]`` are the values of the color on either
178178# side of the anchor point.
179179#
180- # If there are no discontinuities, then ``yleft[i]= yright[i]``:
180+ # If there are no discontinuities, then ``yleft[i] == yright[i]``:
181181
182182cdict = {'red' : [[0.0 , 0.0 , 0.0 ],
183183 [0.5 , 1.0 , 1.0 ],
@@ -221,9 +221,10 @@ def plot_linearmap(cdict):
221221#
222222# In the example below there is a discontinuity in red at 0.5. The
223223# interpolation between 0 and 0.5 goes from 0.3 to 1, and between 0.5 and 1
224- # it goes from 0.9 to 1. Note that red[0, 1], and red[2, 2] are both
225- # superfluous to the interpolation because red[0, 1] is the value to the
226- # left of 0, and red[2, 2] is the value to the right of 1.0.
224+ # it goes from 0.9 to 1. Note that ``red[0, 1]``, and ``red[2, 2]`` are both
225+ # superfluous to the interpolation because ``red[0, 1]`` (i.e., ``yleft[0]``)
226+ # is the value to the left of 0, and ``red[2, 2]`` (i.e., ``yright[2]``) is the
227+ # value to the right of 1, which are outside the color mapping domain.
227228
228229cdict ['red' ] = [[0.0 , 0.0 , 0.3 ],
229230 [0.5 , 1.0 , 0.9 ],
@@ -234,7 +235,7 @@ def plot_linearmap(cdict):
234235# Directly creating a segmented colormap from a list
235236# --------------------------------------------------
236237#
237- # The above described is a very versatile approach , but admittedly a bit
238+ # The approach described above is very versatile, but admittedly a bit
238239# cumbersome to implement. For some basic cases, the use of
239240# `.LinearSegmentedColormap.from_list` may be easier. This creates a segmented
240241# colormap with equal spacings from a supplied list of colors.
@@ -243,8 +244,8 @@ def plot_linearmap(cdict):
243244cmap1 = LinearSegmentedColormap .from_list ("mycmap" , colors )
244245
245246#############################################################################
246- # If desired, the nodes of the colormap can be given as numbers
247- # between 0 and 1. E.g. one could have the reddish part take more space in the
247+ # If desired, the nodes of the colormap can be given as numbers between 0 and
248+ # 1. For example, one could have the reddish part take more space in the
248249# colormap.
249250
250251nodes = [0.0 , 0.4 , 0.8 , 1.0 ]
0 commit comments