Skip to content

Commit 284f56a

Browse files
committed
Merge branch 'v1.4.x'
2 parents 3ca461e + 9900271 commit 284f56a

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

doc/make.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import os
77
import shutil
88
import sys
9+
import re
910

1011
### Begin compatibility block for pre-v2.6: ###
1112
#
@@ -135,21 +136,32 @@ def doctest():
135136
def linkcheck():
136137
os.system('sphinx-build -b linkcheck -d build/doctrees . build/linkcheck')
137138

138-
def html():
139+
def html(buildername='html'):
139140
check_build()
140141
copy_if_out_of_date('../lib/matplotlib/mpl-data/matplotlibrc', '_static/matplotlibrc')
141142
if small_docs:
142143
options = "-D plot_formats=\"[('png', 80)]\""
143144
else:
144145
options = ''
145-
if os.system('sphinx-build %s -b html -d build/doctrees . build/html' % options):
146+
if os.system('sphinx-build %s -b %s -d build/doctrees . build/%s' % (options, buildername, buildername)):
146147
raise SystemExit("Building HTML failed.")
147148

148149
# Clean out PDF files from the _images directory
149-
for filename in glob.glob('build/html/_images/*.pdf'):
150+
for filename in glob.glob('build/%s/_images/*.pdf' % buildername):
150151
os.remove(filename)
151152

152-
shutil.copy('../CHANGELOG', 'build/html/_static/CHANGELOG')
153+
shutil.copy('../CHANGELOG', 'build/%s/_static/CHANGELOG' % buildername)
154+
155+
def htmlhelp():
156+
html(buildername='htmlhelp')
157+
# remove scripts from index.html
158+
with open('build/htmlhelp/index.html', 'r+') as fh:
159+
content = fh.read()
160+
fh.seek(0)
161+
content = re.sub(r'<script>.*?</script>', '', content,
162+
flags=re.MULTILINE| re.DOTALL)
163+
fh.write(content)
164+
fh.truncate()
153165

154166
def latex():
155167
check_build()
@@ -213,6 +225,7 @@ def all():
213225

214226
funcd = {
215227
'html' : html,
228+
'htmlhelp' : htmlhelp,
216229
'latex' : latex,
217230
'texinfo' : texinfo,
218231
'clean' : clean,

doc/sphinxext/gen_gallery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def out_of_date(original, derived):
6161

6262

6363
def gen_gallery(app, doctree):
64-
if app.builder.name != 'html':
64+
if app.builder.name not in ('html', 'htmlhelp'):
6565
return
6666

6767
outdir = app.builder.outdir

doc/users/colormaps.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ For the Sequential plots, the lightness value increases monotonically through th
4545
Sequential2
4646
-----------
4747

48-
Many of the :math:`L^*` values from the Sequential2 plots are monotonically increasing, but some (autumn, cool, spring, and winter) plateau or even go both up and down in :math:`L^*` space. Others (afmhot, copper, gist_heat, and hot) have kinks in the :math:`L^*` functions. Data that is being represented in a region of the colormap that is at a plateau or kink will lead to a perception of banding of the data in those values in the colormap (see [mycarta_banding]_ for an excellent example of this).
48+
Many of the :math:`L^*` values from the Sequential2 plots are monotonically increasing, but some (autumn, cool, spring, and winter) plateau or even go both up and down in :math:`L^*` space. Others (afmhot, copper, gist_heat, and hot) have kinks in the :math:`L^*` functions. Data that is being represented in a region of the colormap that is at a plateau or kink will lead to a perception of banding of the data in those values in the colormap (see [mycarta-banding]_ for an excellent example of this).
4949

5050
Diverging
5151
---------
@@ -62,15 +62,15 @@ Miscellaneous
6262

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

65-
The often-used jet colormap is included in this set of colormaps. We can see that the :math:`L^*` values vary widely throughout the colormap, making it a poor choice for representing data for viewers to see perceptually. See an extension on this idea at [mycarta_jet]_.
65+
The often-used jet colormap is included in this set of colormaps. We can see that the :math:`L^*` values vary widely throughout the colormap, making it a poor choice for representing data for viewers to see perceptually. See an extension on this idea at [mycarta-jet]_.
6666

6767
.. plot:: users/plotting/colormaps/lightness.py
6868

6969

7070
:math:`L^*` function
7171
====================
7272

73-
There are multiple approaches to finding the best function for :math:`L^*` across a colormap. Linear gives reasonable results (*e.g.*, [mycarta_banding]_, [mycarta_lablinear]_). However, the Weber-Fechner law, and more generally and recently, Stevens' Law, indicates that a logarithmic or geometric relationship might be better (see effort on this front at [mycarta_cubelaw]_).
73+
There are multiple approaches to finding the best function for :math:`L^*` across a colormap. Linear gives reasonable results (*e.g.*, [mycarta-banding]_, [mycarta-lablinear]_). However, the Weber-Fechner law, and more generally and recently, Stevens' Law, indicates that a logarithmic or geometric relationship might be better (see effort on this front at [mycarta-cubelaw]_).
7474

7575
.. plot:: users/plotting/colormaps/Lfunction.py
7676

@@ -101,10 +101,10 @@ References
101101
.. [Ware] http://ccom.unh.edu/sites/default/files/publications/Ware_1988_CGA_Color_sequences_univariate_maps.pdf
102102
.. [Moreland] http://www.sandia.gov/~kmorel/documents/ColorMaps/ColorMapsExpanded.pdf
103103
.. [colormaps] https://gist.github.com/endolith/2719900#id7
104-
.. [mycarta_banding] http://mycarta.wordpress.com/2012/10/14/the-rainbow-is-deadlong-live-the-rainbow-part-4-cie-lab-heated-body/
105-
.. [mycarta_jet] http://mycarta.wordpress.com/2012/10/06/the-rainbow-is-deadlong-live-the-rainbow-part-3/
106-
.. [mycarta_lablinear] http://mycarta.wordpress.com/2012/12/06/the-rainbow-is-deadlong-live-the-rainbow-part-5-cie-lab-linear-l-rainbow/
107-
.. [mycarta_cubelaw] http://mycarta.wordpress.com/2013/02/21/perceptual-rainbow-palette-the-method/
104+
.. [mycarta-banding] http://mycarta.wordpress.com/2012/10/14/the-rainbow-is-deadlong-live-the-rainbow-part-4-cie-lab-heated-body/
105+
.. [mycarta-jet] http://mycarta.wordpress.com/2012/10/06/the-rainbow-is-deadlong-live-the-rainbow-part-3/
106+
.. [mycarta-lablinear] http://mycarta.wordpress.com/2012/12/06/the-rainbow-is-deadlong-live-the-rainbow-part-5-cie-lab-linear-l-rainbow/
107+
.. [mycarta-cubelaw] http://mycarta.wordpress.com/2013/02/21/perceptual-rainbow-palette-the-method/
108108
.. [bw] http://www.tannerhelland.com/3643/grayscale-image-algorithm-vb6/
109109
.. [colorblindness] http://aspnetresources.com/tools/colorBlindness
110110
.. [asp] http://aspnetresources.com/tools/colorBlindness

0 commit comments

Comments
 (0)