Skip to content

Commit e01552c

Browse files
committed
Address @QuLogic's feedback
1 parent ba19f2b commit e01552c

File tree

4 files changed

+27
-22
lines changed

4 files changed

+27
-22
lines changed

doc/users/colormaps.rst

+15-13
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,15 @@ These would not be good options for use as perceptual colormaps.
109109
Miscellaneous
110110
-------------
111111

112-
Some of the miscellaneous colormaps have particular uses they have been created
113-
for. For example, gist_earth, ocean, and terrain all seem to be created for
114-
plotting topography (green/brown) and water depths (blue) together. We would
115-
expect to see a divergence in these colormaps, then, but multiple kinks may not
116-
be ideal, such as in gist_earth and terrain. CMRmap was created to convert well
117-
to grayscale, though it does appear to have some small kinks in :math:`L^*`.
118-
cubehelix was created to vary smoothly in both lightness and hue, but appears to
119-
have a small hump in the green hue area.
112+
Some of the miscellaneous colormaps have particular uses for which
113+
they have been created. For example, gist_earth, ocean, and terrain
114+
all seem to be created for plotting topography (green/brown) and water
115+
depths (blue) together. We would expect to see a divergence in these
116+
colormaps, then, but multiple kinks may not be ideal, such as in
117+
gist_earth and terrain. CMRmap was created to convert well to
118+
grayscale, though it does appear to have some small kinks in
119+
:math:`L^*`. cubehelix was created to vary smoothly in both lightness
120+
and hue, but appears to have a small hump in the green hue area.
120121

121122
The often-used jet colormap is included in this set of colormaps. We can see
122123
that the :math:`L^*` values vary widely throughout the colormap, making it a
@@ -141,17 +142,18 @@ might be better (see effort on this front at [mycarta-cubelaw]_).
141142
Grayscale conversion
142143
====================
143144

144-
Conversion to grayscale is important to pay attention to for printing
145-
publications that have color plots. If this is not paid attention to ahead of
146-
time, your readers may end up with indecipherable plots because the grayscale
147-
changes unpredictably through the colormap.
145+
It is important to pay attention to conversion to grayscale for color
146+
plots, since they may be printed on black and white printers. If not
147+
carefully considered, your readers may end up with indecipherable
148+
plots because the grayscale changes unpredictably through the
149+
colormap.
148150

149151
Conversion to grayscale is done in many different ways [bw]_. Some of the better
150152
ones use a linear combination of the rgb values of a pixel, but weighted
151153
according to how we perceive color intensity. A nonlinear method of conversion
152154
to grayscale is to use the :math:`L^*` values of the pixels. In general, similar
153155
principles apply for this question as they do for presenting one's information
154-
perceptually; that is, if a colormap is chosen that has monotonically increasing
156+
perceptually; that is, if a colormap is chosen that is monotonically increasing
155157
in :math:`L^*` values, it will print in a reasonable manner to grayscale.
156158

157159
With this in mind, we see that the Sequential colormaps have reasonable

doc/users/plotting/colormaps/Lfunction.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@
77
import matplotlib.pyplot as plt
88
import colorconv as color
99
#from skimage import color
10-
# we are using a local copy of colorconv from scikit-image to reduce dependencies.
11-
# You should probably use the one from scikit-image in most cases.
10+
# we are using a local copy of colorconv from scikit-image to reduce dependencies.
11+
# You should probably use the one from scikit-image in most cases.
1212
import matplotlib as mpl
1313
from matplotlib import cm
1414

1515

1616
mpl.rcParams.update({'font.size': 12})
17-
mpl.rcParams['font.sans-serif'] = ('Arev Sans, Bitstream Vera Sans,'
18-
'Lucida Grande, Verdana, Geneva, Lucid, Helvetica, Avant Garde, sans-serif')
17+
mpl.rcParams['font.sans-serif'] = ('Arev Sans, Bitstream Vera Sans, '
18+
'Lucida Grande, Verdana, Geneva, Lucid, '
19+
'Helvetica, Avant Garde, sans-serif')
1920
mpl.rcParams['mathtext.fontset'] = 'custom'
2021
mpl.rcParams['mathtext.cal'] = 'cursive'
2122
mpl.rcParams['mathtext.rm'] = 'sans'
@@ -161,7 +162,7 @@
161162

162163
# common ylabel
163164
ax1.text(-0.3, 4.5, 'Steps through map indices',
164-
rotation=90, transform=ax1.transAxes)
165+
rotation=90, transform=ax1.transAxes)
165166

166167
fig.subplots_adjust(hspace=0.0)
167168
plt.show()

doc/users/plotting/colormaps/grayscale.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
import matplotlib as mpl
1717

1818
mpl.rcParams.update({'font.size': 14})
19-
mpl.rcParams['font.sans-serif'] = ('Arev Sans, Bitstream Vera Sans,'
20-
'Lucida Grande, Verdana, Geneva, Lucid, Helvetica, Avant Garde, sans-serif')
19+
mpl.rcParams['font.sans-serif'] = ('Arev Sans, Bitstream Vera Sans, '
20+
'Lucida Grande, Verdana, Geneva, Lucid, '
21+
'Helvetica, Avant Garde, sans-serif')
2122
mpl.rcParams['mathtext.fontset'] = 'custom'
2223
mpl.rcParams['mathtext.cal'] = 'cursive'
2324
mpl.rcParams['mathtext.rm'] = 'sans'

doc/users/plotting/colormaps/lightness.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
import matplotlib as mpl
1717

1818
mpl.rcParams.update({'font.size': 12})
19-
mpl.rcParams['font.sans-serif'] = ('Arev Sans, Bitstream Vera Sans,'
20-
'Lucida Grande, Verdana, Geneva, Lucid, Helvetica, Avant Garde, sans-serif')
19+
mpl.rcParams['font.sans-serif'] = ('Arev Sans, Bitstream Vera Sans, '
20+
'Lucida Grande, Verdana, Geneva, Lucid, '
21+
'Helvetica, Avant Garde, sans-serif')
2122
mpl.rcParams['mathtext.fontset'] = 'custom'
2223
mpl.rcParams['mathtext.cal'] = 'cursive'
2324
mpl.rcParams['mathtext.rm'] = 'sans'

0 commit comments

Comments
 (0)