@@ -255,6 +255,38 @@ def setp(*args, **kwargs):
255
255
draw_if_interactive ()
256
256
return ret
257
257
258
+ def xkcd ():
259
+ """
260
+ Turns on `xkcd <xkcd.com>`_ sketch-style drawing mode. This will
261
+ only have effect on things drawn after this function is called.
262
+
263
+ For best results, the "Humor Sans" font should be installed: it is
264
+ not included with matplotlib.
265
+
266
+ This function works by setting a whole slew of rcParams, so it will
267
+ probably override others you have set before.
268
+ """
269
+ from matplotlib import patheffects
270
+ rcParams ['text.usetex' ] = False
271
+ rcParams ['font.family' ] = 'fantasy'
272
+ rcParams ['font.fantasy' ] = ['Humor Sans' , 'Comic Sans MS' ]
273
+ rcParams ['font.size' ] = 14.0
274
+ rcParams ['path.sketch' ] = (1 , 100 , 2 )
275
+ rcParams ['path.effects' ] = [
276
+ patheffects .withStroke (linewidth = 4 , foreground = "w" )]
277
+ rcParams ['axes.linewidth' ] = 1.5
278
+ rcParams ['lines.linewidth' ] = 2.0
279
+ rcParams ['figure.facecolor' ] = 'white'
280
+ rcParams ['grid.linewidth' ] = 0.0
281
+ rcParams ['axes.unicode_minus' ] = False
282
+ rcParams ['axes.color_cycle' ] = ['b' , 'r' , 'c' , 'm' ]
283
+ # rcParams['axes.clip'] = False
284
+ rcParams ['xtick.major.size' ] = 8
285
+ rcParams ['xtick.major.width' ] = 3
286
+ rcParams ['ytick.major.size' ] = 8
287
+ rcParams ['ytick.major.width' ] = 3
288
+
289
+
258
290
## Figures ##
259
291
260
292
@@ -1790,7 +1822,7 @@ def colormaps():
1790
1822
for nominal data that has no inherent ordering, where color is used
1791
1823
only to distinguish categories
1792
1824
1793
- The base colormaps are derived from those of the same name provided
1825
+ The base colormaps are derived from those of the same name provided
1794
1826
with Matlab:
1795
1827
1796
1828
========= =======================================================
@@ -1942,14 +1974,14 @@ def colormaps():
1942
1974
rainbow spectral purple-blue-green-yellow-orange-red colormap
1943
1975
with diverging luminance
1944
1976
seismic diverging blue-white-red
1945
- nipy_spectral black-purple-blue-green-yellow-red-white spectrum,
1977
+ nipy_spectral black-purple-blue-green-yellow-red-white spectrum,
1946
1978
originally from the Neuroimaging in Python project
1947
1979
terrain mapmaker's colors, blue-green-yellow-brown-white,
1948
1980
originally from IGOR Pro
1949
1981
============= =======================================================
1950
1982
1951
1983
The following colormaps are redundant and may be removed in future
1952
- versions. It's recommended to use the names in the descriptions
1984
+ versions. It's recommended to use the names in the descriptions
1953
1985
instead, which produce identical output:
1954
1986
1955
1987
========= =======================================================
@@ -1980,11 +2012,11 @@ def colormaps():
1980
2012
Color-Scale Images
1981
2013
<http://www.mathworks.com/matlabcentral/fileexchange/2662-cmrmap-m>`_
1982
2014
by Carey Rappaport
1983
-
2015
+
1984
2016
.. [#] Changed to distinguish from ColorBrewer's *Spectral* map.
1985
- :func:`spectral` still works, but
2017
+ :func:`spectral` still works, but
1986
2018
``set_cmap('nipy_spectral')`` is recommended for clarity.
1987
-
2019
+
1988
2020
1989
2021
"""
1990
2022
return sorted (cm .cmap_d .keys ())
0 commit comments