_cm.py 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426
  1. """
  2. Nothing here but dictionaries for generating LinearSegmentedColormaps,
  3. and a dictionary of these dictionaries.
  4. Documentation for each is in pyplot.colormaps(). Please update this
  5. with the purpose and type of your colormap if you add data for one here.
  6. """
  7. from functools import partial
  8. import numpy as np
  9. _binary_data = {
  10. 'red': ((0., 1., 1.), (1., 0., 0.)),
  11. 'green': ((0., 1., 1.), (1., 0., 0.)),
  12. 'blue': ((0., 1., 1.), (1., 0., 0.))
  13. }
  14. _autumn_data = {'red': ((0., 1.0, 1.0), (1.0, 1.0, 1.0)),
  15. 'green': ((0., 0., 0.), (1.0, 1.0, 1.0)),
  16. 'blue': ((0., 0., 0.), (1.0, 0., 0.))}
  17. _bone_data = {'red': ((0., 0., 0.),
  18. (0.746032, 0.652778, 0.652778),
  19. (1.0, 1.0, 1.0)),
  20. 'green': ((0., 0., 0.),
  21. (0.365079, 0.319444, 0.319444),
  22. (0.746032, 0.777778, 0.777778),
  23. (1.0, 1.0, 1.0)),
  24. 'blue': ((0., 0., 0.),
  25. (0.365079, 0.444444, 0.444444),
  26. (1.0, 1.0, 1.0))}
  27. _cool_data = {'red': ((0., 0., 0.), (1.0, 1.0, 1.0)),
  28. 'green': ((0., 1., 1.), (1.0, 0., 0.)),
  29. 'blue': ((0., 1., 1.), (1.0, 1., 1.))}
  30. _copper_data = {'red': ((0., 0., 0.),
  31. (0.809524, 1.000000, 1.000000),
  32. (1.0, 1.0, 1.0)),
  33. 'green': ((0., 0., 0.),
  34. (1.0, 0.7812, 0.7812)),
  35. 'blue': ((0., 0., 0.),
  36. (1.0, 0.4975, 0.4975))}
  37. def _flag_red(x): return 0.75 * np.sin((x * 31.5 + 0.25) * np.pi) + 0.5
  38. def _flag_green(x): return np.sin(x * 31.5 * np.pi)
  39. def _flag_blue(x): return 0.75 * np.sin((x * 31.5 - 0.25) * np.pi) + 0.5
  40. _flag_data = {'red': _flag_red, 'green': _flag_green, 'blue': _flag_blue}
  41. def _prism_red(x): return 0.75 * np.sin((x * 20.9 + 0.25) * np.pi) + 0.67
  42. def _prism_green(x): return 0.75 * np.sin((x * 20.9 - 0.25) * np.pi) + 0.33
  43. def _prism_blue(x): return -1.1 * np.sin((x * 20.9) * np.pi)
  44. _prism_data = {'red': _prism_red, 'green': _prism_green, 'blue': _prism_blue}
  45. def _ch_helper(gamma, s, r, h, p0, p1, x):
  46. """Helper function for generating picklable cubehelix color maps."""
  47. # Apply gamma factor to emphasise low or high intensity values
  48. xg = x ** gamma
  49. # Calculate amplitude and angle of deviation from the black to white
  50. # diagonal in the plane of constant perceived intensity.
  51. a = h * xg * (1 - xg) / 2
  52. phi = 2 * np.pi * (s / 3 + r * x)
  53. return xg + a * (p0 * np.cos(phi) + p1 * np.sin(phi))
  54. def cubehelix(gamma=1.0, s=0.5, r=-1.5, h=1.0):
  55. """
  56. Return custom data dictionary of (r, g, b) conversion functions, which can
  57. be used with :func:`register_cmap`, for the cubehelix color scheme.
  58. Unlike most other color schemes cubehelix was designed by D.A. Green to
  59. be monotonically increasing in terms of perceived brightness.
  60. Also, when printed on a black and white postscript printer, the scheme
  61. results in a greyscale with monotonically increasing brightness.
  62. This color scheme is named cubehelix because the (r, g, b) values produced
  63. can be visualised as a squashed helix around the diagonal in the
  64. (r, g, b) color cube.
  65. For a unit color cube (i.e. 3-D coordinates for (r, g, b) each in the
  66. range 0 to 1) the color scheme starts at (r, g, b) = (0, 0, 0), i.e. black,
  67. and finishes at (r, g, b) = (1, 1, 1), i.e. white. For some fraction *x*,
  68. between 0 and 1, the color is the corresponding grey value at that
  69. fraction along the black to white diagonal (x, x, x) plus a color
  70. element. This color element is calculated in a plane of constant
  71. perceived intensity and controlled by the following parameters.
  72. Optional keyword arguments:
  73. ========= =======================================================
  74. Keyword Description
  75. ========= =======================================================
  76. gamma gamma factor to emphasise either low intensity values
  77. (gamma < 1), or high intensity values (gamma > 1);
  78. defaults to 1.0.
  79. s the start color; defaults to 0.5 (i.e. purple).
  80. r the number of r, g, b rotations in color that are made
  81. from the start to the end of the color scheme; defaults
  82. to -1.5 (i.e. -> B -> G -> R -> B).
  83. h the hue parameter which controls how saturated the
  84. colors are. If this parameter is zero then the color
  85. scheme is purely a greyscale; defaults to 1.0.
  86. ========= =======================================================
  87. """
  88. return {'red': partial(_ch_helper, gamma, s, r, h, -0.14861, 1.78277),
  89. 'green': partial(_ch_helper, gamma, s, r, h, -0.29227, -0.90649),
  90. 'blue': partial(_ch_helper, gamma, s, r, h, 1.97294, 0.0)}
  91. _cubehelix_data = cubehelix()
  92. _bwr_data = ((0.0, 0.0, 1.0), (1.0, 1.0, 1.0), (1.0, 0.0, 0.0))
  93. _brg_data = ((0.0, 0.0, 1.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0))
  94. # Gnuplot palette functions
  95. def _g0(x): return 0
  96. def _g1(x): return 0.5
  97. def _g2(x): return 1
  98. def _g3(x): return x
  99. def _g4(x): return x ** 2
  100. def _g5(x): return x ** 3
  101. def _g6(x): return x ** 4
  102. def _g7(x): return np.sqrt(x)
  103. def _g8(x): return np.sqrt(np.sqrt(x))
  104. def _g9(x): return np.sin(x * np.pi / 2)
  105. def _g10(x): return np.cos(x * np.pi / 2)
  106. def _g11(x): return np.abs(x - 0.5)
  107. def _g12(x): return (2 * x - 1) ** 2
  108. def _g13(x): return np.sin(x * np.pi)
  109. def _g14(x): return np.abs(np.cos(x * np.pi))
  110. def _g15(x): return np.sin(x * 2 * np.pi)
  111. def _g16(x): return np.cos(x * 2 * np.pi)
  112. def _g17(x): return np.abs(np.sin(x * 2 * np.pi))
  113. def _g18(x): return np.abs(np.cos(x * 2 * np.pi))
  114. def _g19(x): return np.abs(np.sin(x * 4 * np.pi))
  115. def _g20(x): return np.abs(np.cos(x * 4 * np.pi))
  116. def _g21(x): return 3 * x
  117. def _g22(x): return 3 * x - 1
  118. def _g23(x): return 3 * x - 2
  119. def _g24(x): return np.abs(3 * x - 1)
  120. def _g25(x): return np.abs(3 * x - 2)
  121. def _g26(x): return (3 * x - 1) / 2
  122. def _g27(x): return (3 * x - 2) / 2
  123. def _g28(x): return np.abs((3 * x - 1) / 2)
  124. def _g29(x): return np.abs((3 * x - 2) / 2)
  125. def _g30(x): return x / 0.32 - 0.78125
  126. def _g31(x): return 2 * x - 0.84
  127. def _g32(x):
  128. ret = np.zeros(len(x))
  129. m = (x < 0.25)
  130. ret[m] = 4 * x[m]
  131. m = (x >= 0.25) & (x < 0.92)
  132. ret[m] = -2 * x[m] + 1.84
  133. m = (x >= 0.92)
  134. ret[m] = x[m] / 0.08 - 11.5
  135. return ret
  136. def _g33(x): return np.abs(2 * x - 0.5)
  137. def _g34(x): return 2 * x
  138. def _g35(x): return 2 * x - 0.5
  139. def _g36(x): return 2 * x - 1
  140. gfunc = {i: globals()["_g{}".format(i)] for i in range(37)}
  141. _gnuplot_data = {
  142. 'red': gfunc[7],
  143. 'green': gfunc[5],
  144. 'blue': gfunc[15],
  145. }
  146. _gnuplot2_data = {
  147. 'red': gfunc[30],
  148. 'green': gfunc[31],
  149. 'blue': gfunc[32],
  150. }
  151. _ocean_data = {
  152. 'red': gfunc[23],
  153. 'green': gfunc[28],
  154. 'blue': gfunc[3],
  155. }
  156. _afmhot_data = {
  157. 'red': gfunc[34],
  158. 'green': gfunc[35],
  159. 'blue': gfunc[36],
  160. }
  161. _rainbow_data = {
  162. 'red': gfunc[33],
  163. 'green': gfunc[13],
  164. 'blue': gfunc[10],
  165. }
  166. _seismic_data = (
  167. (0.0, 0.0, 0.3), (0.0, 0.0, 1.0),
  168. (1.0, 1.0, 1.0), (1.0, 0.0, 0.0),
  169. (0.5, 0.0, 0.0))
  170. _terrain_data = (
  171. (0.00, (0.2, 0.2, 0.6)),
  172. (0.15, (0.0, 0.6, 1.0)),
  173. (0.25, (0.0, 0.8, 0.4)),
  174. (0.50, (1.0, 1.0, 0.6)),
  175. (0.75, (0.5, 0.36, 0.33)),
  176. (1.00, (1.0, 1.0, 1.0)))
  177. _gray_data = {'red': ((0., 0, 0), (1., 1, 1)),
  178. 'green': ((0., 0, 0), (1., 1, 1)),
  179. 'blue': ((0., 0, 0), (1., 1, 1))}
  180. _hot_data = {'red': ((0., 0.0416, 0.0416),
  181. (0.365079, 1.000000, 1.000000),
  182. (1.0, 1.0, 1.0)),
  183. 'green': ((0., 0., 0.),
  184. (0.365079, 0.000000, 0.000000),
  185. (0.746032, 1.000000, 1.000000),
  186. (1.0, 1.0, 1.0)),
  187. 'blue': ((0., 0., 0.),
  188. (0.746032, 0.000000, 0.000000),
  189. (1.0, 1.0, 1.0))}
  190. _hsv_data = {'red': ((0., 1., 1.),
  191. (0.158730, 1.000000, 1.000000),
  192. (0.174603, 0.968750, 0.968750),
  193. (0.333333, 0.031250, 0.031250),
  194. (0.349206, 0.000000, 0.000000),
  195. (0.666667, 0.000000, 0.000000),
  196. (0.682540, 0.031250, 0.031250),
  197. (0.841270, 0.968750, 0.968750),
  198. (0.857143, 1.000000, 1.000000),
  199. (1.0, 1.0, 1.0)),
  200. 'green': ((0., 0., 0.),
  201. (0.158730, 0.937500, 0.937500),
  202. (0.174603, 1.000000, 1.000000),
  203. (0.507937, 1.000000, 1.000000),
  204. (0.666667, 0.062500, 0.062500),
  205. (0.682540, 0.000000, 0.000000),
  206. (1.0, 0., 0.)),
  207. 'blue': ((0., 0., 0.),
  208. (0.333333, 0.000000, 0.000000),
  209. (0.349206, 0.062500, 0.062500),
  210. (0.507937, 1.000000, 1.000000),
  211. (0.841270, 1.000000, 1.000000),
  212. (0.857143, 0.937500, 0.937500),
  213. (1.0, 0.09375, 0.09375))}
  214. _jet_data = {'red': ((0., 0, 0), (0.35, 0, 0), (0.66, 1, 1), (0.89, 1, 1),
  215. (1, 0.5, 0.5)),
  216. 'green': ((0., 0, 0), (0.125, 0, 0), (0.375, 1, 1), (0.64, 1, 1),
  217. (0.91, 0, 0), (1, 0, 0)),
  218. 'blue': ((0., 0.5, 0.5), (0.11, 1, 1), (0.34, 1, 1),
  219. (0.65, 0, 0), (1, 0, 0))}
  220. _pink_data = {'red': ((0., 0.1178, 0.1178), (0.015873, 0.195857, 0.195857),
  221. (0.031746, 0.250661, 0.250661),
  222. (0.047619, 0.295468, 0.295468),
  223. (0.063492, 0.334324, 0.334324),
  224. (0.079365, 0.369112, 0.369112),
  225. (0.095238, 0.400892, 0.400892),
  226. (0.111111, 0.430331, 0.430331),
  227. (0.126984, 0.457882, 0.457882),
  228. (0.142857, 0.483867, 0.483867),
  229. (0.158730, 0.508525, 0.508525),
  230. (0.174603, 0.532042, 0.532042),
  231. (0.190476, 0.554563, 0.554563),
  232. (0.206349, 0.576204, 0.576204),
  233. (0.222222, 0.597061, 0.597061),
  234. (0.238095, 0.617213, 0.617213),
  235. (0.253968, 0.636729, 0.636729),
  236. (0.269841, 0.655663, 0.655663),
  237. (0.285714, 0.674066, 0.674066),
  238. (0.301587, 0.691980, 0.691980),
  239. (0.317460, 0.709441, 0.709441),
  240. (0.333333, 0.726483, 0.726483),
  241. (0.349206, 0.743134, 0.743134),
  242. (0.365079, 0.759421, 0.759421),
  243. (0.380952, 0.766356, 0.766356),
  244. (0.396825, 0.773229, 0.773229),
  245. (0.412698, 0.780042, 0.780042),
  246. (0.428571, 0.786796, 0.786796),
  247. (0.444444, 0.793492, 0.793492),
  248. (0.460317, 0.800132, 0.800132),
  249. (0.476190, 0.806718, 0.806718),
  250. (0.492063, 0.813250, 0.813250),
  251. (0.507937, 0.819730, 0.819730),
  252. (0.523810, 0.826160, 0.826160),
  253. (0.539683, 0.832539, 0.832539),
  254. (0.555556, 0.838870, 0.838870),
  255. (0.571429, 0.845154, 0.845154),
  256. (0.587302, 0.851392, 0.851392),
  257. (0.603175, 0.857584, 0.857584),
  258. (0.619048, 0.863731, 0.863731),
  259. (0.634921, 0.869835, 0.869835),
  260. (0.650794, 0.875897, 0.875897),
  261. (0.666667, 0.881917, 0.881917),
  262. (0.682540, 0.887896, 0.887896),
  263. (0.698413, 0.893835, 0.893835),
  264. (0.714286, 0.899735, 0.899735),
  265. (0.730159, 0.905597, 0.905597),
  266. (0.746032, 0.911421, 0.911421),
  267. (0.761905, 0.917208, 0.917208),
  268. (0.777778, 0.922958, 0.922958),
  269. (0.793651, 0.928673, 0.928673),
  270. (0.809524, 0.934353, 0.934353),
  271. (0.825397, 0.939999, 0.939999),
  272. (0.841270, 0.945611, 0.945611),
  273. (0.857143, 0.951190, 0.951190),
  274. (0.873016, 0.956736, 0.956736),
  275. (0.888889, 0.962250, 0.962250),
  276. (0.904762, 0.967733, 0.967733),
  277. (0.920635, 0.973185, 0.973185),
  278. (0.936508, 0.978607, 0.978607),
  279. (0.952381, 0.983999, 0.983999),
  280. (0.968254, 0.989361, 0.989361),
  281. (0.984127, 0.994695, 0.994695), (1.0, 1.0, 1.0)),
  282. 'green': ((0., 0., 0.), (0.015873, 0.102869, 0.102869),
  283. (0.031746, 0.145479, 0.145479),
  284. (0.047619, 0.178174, 0.178174),
  285. (0.063492, 0.205738, 0.205738),
  286. (0.079365, 0.230022, 0.230022),
  287. (0.095238, 0.251976, 0.251976),
  288. (0.111111, 0.272166, 0.272166),
  289. (0.126984, 0.290957, 0.290957),
  290. (0.142857, 0.308607, 0.308607),
  291. (0.158730, 0.325300, 0.325300),
  292. (0.174603, 0.341178, 0.341178),
  293. (0.190476, 0.356348, 0.356348),
  294. (0.206349, 0.370899, 0.370899),
  295. (0.222222, 0.384900, 0.384900),
  296. (0.238095, 0.398410, 0.398410),
  297. (0.253968, 0.411476, 0.411476),
  298. (0.269841, 0.424139, 0.424139),
  299. (0.285714, 0.436436, 0.436436),
  300. (0.301587, 0.448395, 0.448395),
  301. (0.317460, 0.460044, 0.460044),
  302. (0.333333, 0.471405, 0.471405),
  303. (0.349206, 0.482498, 0.482498),
  304. (0.365079, 0.493342, 0.493342),
  305. (0.380952, 0.517549, 0.517549),
  306. (0.396825, 0.540674, 0.540674),
  307. (0.412698, 0.562849, 0.562849),
  308. (0.428571, 0.584183, 0.584183),
  309. (0.444444, 0.604765, 0.604765),
  310. (0.460317, 0.624669, 0.624669),
  311. (0.476190, 0.643958, 0.643958),
  312. (0.492063, 0.662687, 0.662687),
  313. (0.507937, 0.680900, 0.680900),
  314. (0.523810, 0.698638, 0.698638),
  315. (0.539683, 0.715937, 0.715937),
  316. (0.555556, 0.732828, 0.732828),
  317. (0.571429, 0.749338, 0.749338),
  318. (0.587302, 0.765493, 0.765493),
  319. (0.603175, 0.781313, 0.781313),
  320. (0.619048, 0.796819, 0.796819),
  321. (0.634921, 0.812029, 0.812029),
  322. (0.650794, 0.826960, 0.826960),
  323. (0.666667, 0.841625, 0.841625),
  324. (0.682540, 0.856040, 0.856040),
  325. (0.698413, 0.870216, 0.870216),
  326. (0.714286, 0.884164, 0.884164),
  327. (0.730159, 0.897896, 0.897896),
  328. (0.746032, 0.911421, 0.911421),
  329. (0.761905, 0.917208, 0.917208),
  330. (0.777778, 0.922958, 0.922958),
  331. (0.793651, 0.928673, 0.928673),
  332. (0.809524, 0.934353, 0.934353),
  333. (0.825397, 0.939999, 0.939999),
  334. (0.841270, 0.945611, 0.945611),
  335. (0.857143, 0.951190, 0.951190),
  336. (0.873016, 0.956736, 0.956736),
  337. (0.888889, 0.962250, 0.962250),
  338. (0.904762, 0.967733, 0.967733),
  339. (0.920635, 0.973185, 0.973185),
  340. (0.936508, 0.978607, 0.978607),
  341. (0.952381, 0.983999, 0.983999),
  342. (0.968254, 0.989361, 0.989361),
  343. (0.984127, 0.994695, 0.994695), (1.0, 1.0, 1.0)),
  344. 'blue': ((0., 0., 0.), (0.015873, 0.102869, 0.102869),
  345. (0.031746, 0.145479, 0.145479),
  346. (0.047619, 0.178174, 0.178174),
  347. (0.063492, 0.205738, 0.205738),
  348. (0.079365, 0.230022, 0.230022),
  349. (0.095238, 0.251976, 0.251976),
  350. (0.111111, 0.272166, 0.272166),
  351. (0.126984, 0.290957, 0.290957),
  352. (0.142857, 0.308607, 0.308607),
  353. (0.158730, 0.325300, 0.325300),
  354. (0.174603, 0.341178, 0.341178),
  355. (0.190476, 0.356348, 0.356348),
  356. (0.206349, 0.370899, 0.370899),
  357. (0.222222, 0.384900, 0.384900),
  358. (0.238095, 0.398410, 0.398410),
  359. (0.253968, 0.411476, 0.411476),
  360. (0.269841, 0.424139, 0.424139),
  361. (0.285714, 0.436436, 0.436436),
  362. (0.301587, 0.448395, 0.448395),
  363. (0.317460, 0.460044, 0.460044),
  364. (0.333333, 0.471405, 0.471405),
  365. (0.349206, 0.482498, 0.482498),
  366. (0.365079, 0.493342, 0.493342),
  367. (0.380952, 0.503953, 0.503953),
  368. (0.396825, 0.514344, 0.514344),
  369. (0.412698, 0.524531, 0.524531),
  370. (0.428571, 0.534522, 0.534522),
  371. (0.444444, 0.544331, 0.544331),
  372. (0.460317, 0.553966, 0.553966),
  373. (0.476190, 0.563436, 0.563436),
  374. (0.492063, 0.572750, 0.572750),
  375. (0.507937, 0.581914, 0.581914),
  376. (0.523810, 0.590937, 0.590937),
  377. (0.539683, 0.599824, 0.599824),
  378. (0.555556, 0.608581, 0.608581),
  379. (0.571429, 0.617213, 0.617213),
  380. (0.587302, 0.625727, 0.625727),
  381. (0.603175, 0.634126, 0.634126),
  382. (0.619048, 0.642416, 0.642416),
  383. (0.634921, 0.650600, 0.650600),
  384. (0.650794, 0.658682, 0.658682),
  385. (0.666667, 0.666667, 0.666667),
  386. (0.682540, 0.674556, 0.674556),
  387. (0.698413, 0.682355, 0.682355),
  388. (0.714286, 0.690066, 0.690066),
  389. (0.730159, 0.697691, 0.697691),
  390. (0.746032, 0.705234, 0.705234),
  391. (0.761905, 0.727166, 0.727166),
  392. (0.777778, 0.748455, 0.748455),
  393. (0.793651, 0.769156, 0.769156),
  394. (0.809524, 0.789314, 0.789314),
  395. (0.825397, 0.808969, 0.808969),
  396. (0.841270, 0.828159, 0.828159),
  397. (0.857143, 0.846913, 0.846913),
  398. (0.873016, 0.865261, 0.865261),
  399. (0.888889, 0.883229, 0.883229),
  400. (0.904762, 0.900837, 0.900837),
  401. (0.920635, 0.918109, 0.918109),
  402. (0.936508, 0.935061, 0.935061),
  403. (0.952381, 0.951711, 0.951711),
  404. (0.968254, 0.968075, 0.968075),
  405. (0.984127, 0.984167, 0.984167), (1.0, 1.0, 1.0))}
  406. _spring_data = {'red': ((0., 1., 1.), (1.0, 1.0, 1.0)),
  407. 'green': ((0., 0., 0.), (1.0, 1.0, 1.0)),
  408. 'blue': ((0., 1., 1.), (1.0, 0.0, 0.0))}
  409. _summer_data = {'red': ((0., 0., 0.), (1.0, 1.0, 1.0)),
  410. 'green': ((0., 0.5, 0.5), (1.0, 1.0, 1.0)),
  411. 'blue': ((0., 0.4, 0.4), (1.0, 0.4, 0.4))}
  412. _winter_data = {'red': ((0., 0., 0.), (1.0, 0.0, 0.0)),
  413. 'green': ((0., 0., 0.), (1.0, 1.0, 1.0)),
  414. 'blue': ((0., 1., 1.), (1.0, 0.5, 0.5))}
  415. _nipy_spectral_data = {
  416. 'red': [(0.0, 0.0, 0.0), (0.05, 0.4667, 0.4667),
  417. (0.10, 0.5333, 0.5333), (0.15, 0.0, 0.0),
  418. (0.20, 0.0, 0.0), (0.25, 0.0, 0.0),
  419. (0.30, 0.0, 0.0), (0.35, 0.0, 0.0),
  420. (0.40, 0.0, 0.0), (0.45, 0.0, 0.0),
  421. (0.50, 0.0, 0.0), (0.55, 0.0, 0.0),
  422. (0.60, 0.0, 0.0), (0.65, 0.7333, 0.7333),
  423. (0.70, 0.9333, 0.9333), (0.75, 1.0, 1.0),
  424. (0.80, 1.0, 1.0), (0.85, 1.0, 1.0),
  425. (0.90, 0.8667, 0.8667), (0.95, 0.80, 0.80),
  426. (1.0, 0.80, 0.80)],
  427. 'green': [(0.0, 0.0, 0.0), (0.05, 0.0, 0.0),
  428. (0.10, 0.0, 0.0), (0.15, 0.0, 0.0),
  429. (0.20, 0.0, 0.0), (0.25, 0.4667, 0.4667),
  430. (0.30, 0.6000, 0.6000), (0.35, 0.6667, 0.6667),
  431. (0.40, 0.6667, 0.6667), (0.45, 0.6000, 0.6000),
  432. (0.50, 0.7333, 0.7333), (0.55, 0.8667, 0.8667),
  433. (0.60, 1.0, 1.0), (0.65, 1.0, 1.0),
  434. (0.70, 0.9333, 0.9333), (0.75, 0.8000, 0.8000),
  435. (0.80, 0.6000, 0.6000), (0.85, 0.0, 0.0),
  436. (0.90, 0.0, 0.0), (0.95, 0.0, 0.0),
  437. (1.0, 0.80, 0.80)],
  438. 'blue': [(0.0, 0.0, 0.0), (0.05, 0.5333, 0.5333),
  439. (0.10, 0.6000, 0.6000), (0.15, 0.6667, 0.6667),
  440. (0.20, 0.8667, 0.8667), (0.25, 0.8667, 0.8667),
  441. (0.30, 0.8667, 0.8667), (0.35, 0.6667, 0.6667),
  442. (0.40, 0.5333, 0.5333), (0.45, 0.0, 0.0),
  443. (0.5, 0.0, 0.0), (0.55, 0.0, 0.0),
  444. (0.60, 0.0, 0.0), (0.65, 0.0, 0.0),
  445. (0.70, 0.0, 0.0), (0.75, 0.0, 0.0),
  446. (0.80, 0.0, 0.0), (0.85, 0.0, 0.0),
  447. (0.90, 0.0, 0.0), (0.95, 0.0, 0.0),
  448. (1.0, 0.80, 0.80)],
  449. }
  450. # 34 colormaps based on color specifications and designs
  451. # developed by Cynthia Brewer (http://colorbrewer.org).
  452. # The ColorBrewer palettes have been included under the terms
  453. # of an Apache-stype license (for details, see the file
  454. # LICENSE_COLORBREWER in the license directory of the matplotlib
  455. # source distribution).
  456. # RGB values taken from Brewer's Excel sheet, divided by 255
  457. _Blues_data = (
  458. (0.96862745098039216, 0.98431372549019602, 1.0 ),
  459. (0.87058823529411766, 0.92156862745098034, 0.96862745098039216),
  460. (0.77647058823529413, 0.85882352941176465, 0.93725490196078431),
  461. (0.61960784313725492, 0.792156862745098 , 0.88235294117647056),
  462. (0.41960784313725491, 0.68235294117647061, 0.83921568627450982),
  463. (0.25882352941176473, 0.5725490196078431 , 0.77647058823529413),
  464. (0.12941176470588237, 0.44313725490196076, 0.70980392156862748),
  465. (0.03137254901960784, 0.31764705882352939, 0.61176470588235299),
  466. (0.03137254901960784, 0.18823529411764706, 0.41960784313725491)
  467. )
  468. _BrBG_data = (
  469. (0.32941176470588235, 0.18823529411764706, 0.0196078431372549 ),
  470. (0.5490196078431373 , 0.31764705882352939, 0.0392156862745098 ),
  471. (0.74901960784313726, 0.50588235294117645, 0.17647058823529413),
  472. (0.87450980392156863, 0.76078431372549016, 0.49019607843137253),
  473. (0.96470588235294119, 0.90980392156862744, 0.76470588235294112),
  474. (0.96078431372549022, 0.96078431372549022, 0.96078431372549022),
  475. (0.7803921568627451 , 0.91764705882352937, 0.89803921568627454),
  476. (0.50196078431372548, 0.80392156862745101, 0.75686274509803919),
  477. (0.20784313725490197, 0.59215686274509804, 0.5607843137254902 ),
  478. (0.00392156862745098, 0.4 , 0.36862745098039218),
  479. (0.0 , 0.23529411764705882, 0.18823529411764706)
  480. )
  481. _BuGn_data = (
  482. (0.96862745098039216, 0.9882352941176471 , 0.99215686274509807),
  483. (0.89803921568627454, 0.96078431372549022, 0.97647058823529409),
  484. (0.8 , 0.92549019607843142, 0.90196078431372551),
  485. (0.6 , 0.84705882352941175, 0.78823529411764703),
  486. (0.4 , 0.76078431372549016, 0.64313725490196083),
  487. (0.25490196078431371, 0.68235294117647061, 0.46274509803921571),
  488. (0.13725490196078433, 0.54509803921568623, 0.27058823529411763),
  489. (0.0 , 0.42745098039215684, 0.17254901960784313),
  490. (0.0 , 0.26666666666666666, 0.10588235294117647)
  491. )
  492. _BuPu_data = (
  493. (0.96862745098039216, 0.9882352941176471 , 0.99215686274509807),
  494. (0.8784313725490196 , 0.92549019607843142, 0.95686274509803926),
  495. (0.74901960784313726, 0.82745098039215681, 0.90196078431372551),
  496. (0.61960784313725492, 0.73725490196078436, 0.85490196078431369),
  497. (0.5490196078431373 , 0.58823529411764708, 0.77647058823529413),
  498. (0.5490196078431373 , 0.41960784313725491, 0.69411764705882351),
  499. (0.53333333333333333, 0.25490196078431371, 0.61568627450980395),
  500. (0.50588235294117645, 0.05882352941176471, 0.48627450980392156),
  501. (0.30196078431372547, 0.0 , 0.29411764705882354)
  502. )
  503. _GnBu_data = (
  504. (0.96862745098039216, 0.9882352941176471 , 0.94117647058823528),
  505. (0.8784313725490196 , 0.95294117647058818, 0.85882352941176465),
  506. (0.8 , 0.92156862745098034, 0.77254901960784317),
  507. (0.6588235294117647 , 0.8666666666666667 , 0.70980392156862748),
  508. (0.4823529411764706 , 0.8 , 0.7686274509803922 ),
  509. (0.30588235294117649, 0.70196078431372544, 0.82745098039215681),
  510. (0.16862745098039217, 0.5490196078431373 , 0.74509803921568629),
  511. (0.03137254901960784, 0.40784313725490196, 0.67450980392156867),
  512. (0.03137254901960784, 0.25098039215686274, 0.50588235294117645)
  513. )
  514. _Greens_data = (
  515. (0.96862745098039216, 0.9882352941176471 , 0.96078431372549022),
  516. (0.89803921568627454, 0.96078431372549022, 0.8784313725490196 ),
  517. (0.7803921568627451 , 0.9137254901960784 , 0.75294117647058822),
  518. (0.63137254901960782, 0.85098039215686272, 0.60784313725490191),
  519. (0.45490196078431372, 0.7686274509803922 , 0.46274509803921571),
  520. (0.25490196078431371, 0.6705882352941176 , 0.36470588235294116),
  521. (0.13725490196078433, 0.54509803921568623, 0.27058823529411763),
  522. (0.0 , 0.42745098039215684, 0.17254901960784313),
  523. (0.0 , 0.26666666666666666, 0.10588235294117647)
  524. )
  525. _Greys_data = (
  526. (1.0 , 1.0 , 1.0 ),
  527. (0.94117647058823528, 0.94117647058823528, 0.94117647058823528),
  528. (0.85098039215686272, 0.85098039215686272, 0.85098039215686272),
  529. (0.74117647058823533, 0.74117647058823533, 0.74117647058823533),
  530. (0.58823529411764708, 0.58823529411764708, 0.58823529411764708),
  531. (0.45098039215686275, 0.45098039215686275, 0.45098039215686275),
  532. (0.32156862745098042, 0.32156862745098042, 0.32156862745098042),
  533. (0.14509803921568629, 0.14509803921568629, 0.14509803921568629),
  534. (0.0 , 0.0 , 0.0 )
  535. )
  536. _Oranges_data = (
  537. (1.0 , 0.96078431372549022, 0.92156862745098034),
  538. (0.99607843137254903, 0.90196078431372551, 0.80784313725490198),
  539. (0.99215686274509807, 0.81568627450980391, 0.63529411764705879),
  540. (0.99215686274509807, 0.68235294117647061, 0.41960784313725491),
  541. (0.99215686274509807, 0.55294117647058827, 0.23529411764705882),
  542. (0.94509803921568625, 0.41176470588235292, 0.07450980392156863),
  543. (0.85098039215686272, 0.28235294117647058, 0.00392156862745098),
  544. (0.65098039215686276, 0.21176470588235294, 0.01176470588235294),
  545. (0.49803921568627452, 0.15294117647058825, 0.01568627450980392)
  546. )
  547. _OrRd_data = (
  548. (1.0 , 0.96862745098039216, 0.92549019607843142),
  549. (0.99607843137254903, 0.90980392156862744, 0.78431372549019607),
  550. (0.99215686274509807, 0.83137254901960789, 0.61960784313725492),
  551. (0.99215686274509807, 0.73333333333333328, 0.51764705882352946),
  552. (0.9882352941176471 , 0.55294117647058827, 0.34901960784313724),
  553. (0.93725490196078431, 0.396078431372549 , 0.28235294117647058),
  554. (0.84313725490196079, 0.18823529411764706, 0.12156862745098039),
  555. (0.70196078431372544, 0.0 , 0.0 ),
  556. (0.49803921568627452, 0.0 , 0.0 )
  557. )
  558. _PiYG_data = (
  559. (0.55686274509803924, 0.00392156862745098, 0.32156862745098042),
  560. (0.77254901960784317, 0.10588235294117647, 0.49019607843137253),
  561. (0.87058823529411766, 0.46666666666666667, 0.68235294117647061),
  562. (0.94509803921568625, 0.71372549019607845, 0.85490196078431369),
  563. (0.99215686274509807, 0.8784313725490196 , 0.93725490196078431),
  564. (0.96862745098039216, 0.96862745098039216, 0.96862745098039216),
  565. (0.90196078431372551, 0.96078431372549022, 0.81568627450980391),
  566. (0.72156862745098038, 0.88235294117647056, 0.52549019607843139),
  567. (0.49803921568627452, 0.73725490196078436, 0.25490196078431371),
  568. (0.30196078431372547, 0.5725490196078431 , 0.12941176470588237),
  569. (0.15294117647058825, 0.39215686274509803, 0.09803921568627451)
  570. )
  571. _PRGn_data = (
  572. (0.25098039215686274, 0.0 , 0.29411764705882354),
  573. (0.46274509803921571, 0.16470588235294117, 0.51372549019607838),
  574. (0.6 , 0.4392156862745098 , 0.6705882352941176 ),
  575. (0.76078431372549016, 0.6470588235294118 , 0.81176470588235294),
  576. (0.90588235294117647, 0.83137254901960789, 0.90980392156862744),
  577. (0.96862745098039216, 0.96862745098039216, 0.96862745098039216),
  578. (0.85098039215686272, 0.94117647058823528, 0.82745098039215681),
  579. (0.65098039215686276, 0.85882352941176465, 0.62745098039215685),
  580. (0.35294117647058826, 0.68235294117647061, 0.38039215686274508),
  581. (0.10588235294117647, 0.47058823529411764, 0.21568627450980393),
  582. (0.0 , 0.26666666666666666, 0.10588235294117647)
  583. )
  584. _PuBu_data = (
  585. (1.0 , 0.96862745098039216, 0.98431372549019602),
  586. (0.92549019607843142, 0.90588235294117647, 0.94901960784313721),
  587. (0.81568627450980391, 0.81960784313725488, 0.90196078431372551),
  588. (0.65098039215686276, 0.74117647058823533, 0.85882352941176465),
  589. (0.45490196078431372, 0.66274509803921566, 0.81176470588235294),
  590. (0.21176470588235294, 0.56470588235294117, 0.75294117647058822),
  591. (0.0196078431372549 , 0.4392156862745098 , 0.69019607843137254),
  592. (0.01568627450980392, 0.35294117647058826, 0.55294117647058827),
  593. (0.00784313725490196, 0.2196078431372549 , 0.34509803921568627)
  594. )
  595. _PuBuGn_data = (
  596. (1.0 , 0.96862745098039216, 0.98431372549019602),
  597. (0.92549019607843142, 0.88627450980392153, 0.94117647058823528),
  598. (0.81568627450980391, 0.81960784313725488, 0.90196078431372551),
  599. (0.65098039215686276, 0.74117647058823533, 0.85882352941176465),
  600. (0.40392156862745099, 0.66274509803921566, 0.81176470588235294),
  601. (0.21176470588235294, 0.56470588235294117, 0.75294117647058822),
  602. (0.00784313725490196, 0.50588235294117645, 0.54117647058823526),
  603. (0.00392156862745098, 0.42352941176470588, 0.34901960784313724),
  604. (0.00392156862745098, 0.27450980392156865, 0.21176470588235294)
  605. )
  606. _PuOr_data = (
  607. (0.49803921568627452, 0.23137254901960785, 0.03137254901960784),
  608. (0.70196078431372544, 0.34509803921568627, 0.02352941176470588),
  609. (0.8784313725490196 , 0.50980392156862742, 0.07843137254901961),
  610. (0.99215686274509807, 0.72156862745098038, 0.38823529411764707),
  611. (0.99607843137254903, 0.8784313725490196 , 0.71372549019607845),
  612. (0.96862745098039216, 0.96862745098039216, 0.96862745098039216),
  613. (0.84705882352941175, 0.85490196078431369, 0.92156862745098034),
  614. (0.69803921568627447, 0.6705882352941176 , 0.82352941176470584),
  615. (0.50196078431372548, 0.45098039215686275, 0.67450980392156867),
  616. (0.32941176470588235, 0.15294117647058825, 0.53333333333333333),
  617. (0.17647058823529413, 0.0 , 0.29411764705882354)
  618. )
  619. _PuRd_data = (
  620. (0.96862745098039216, 0.95686274509803926, 0.97647058823529409),
  621. (0.90588235294117647, 0.88235294117647056, 0.93725490196078431),
  622. (0.83137254901960789, 0.72549019607843135, 0.85490196078431369),
  623. (0.78823529411764703, 0.58039215686274515, 0.7803921568627451 ),
  624. (0.87450980392156863, 0.396078431372549 , 0.69019607843137254),
  625. (0.90588235294117647, 0.16078431372549021, 0.54117647058823526),
  626. (0.80784313725490198, 0.07058823529411765, 0.33725490196078434),
  627. (0.59607843137254901, 0.0 , 0.2627450980392157 ),
  628. (0.40392156862745099, 0.0 , 0.12156862745098039)
  629. )
  630. _Purples_data = (
  631. (0.9882352941176471 , 0.98431372549019602, 0.99215686274509807),
  632. (0.93725490196078431, 0.92941176470588238, 0.96078431372549022),
  633. (0.85490196078431369, 0.85490196078431369, 0.92156862745098034),
  634. (0.73725490196078436, 0.74117647058823533, 0.86274509803921573),
  635. (0.61960784313725492, 0.60392156862745094, 0.78431372549019607),
  636. (0.50196078431372548, 0.49019607843137253, 0.72941176470588232),
  637. (0.41568627450980394, 0.31764705882352939, 0.63921568627450975),
  638. (0.32941176470588235, 0.15294117647058825, 0.5607843137254902 ),
  639. (0.24705882352941178, 0.0 , 0.49019607843137253)
  640. )
  641. _RdBu_data = (
  642. (0.40392156862745099, 0.0 , 0.12156862745098039),
  643. (0.69803921568627447, 0.09411764705882353, 0.16862745098039217),
  644. (0.83921568627450982, 0.37647058823529411, 0.30196078431372547),
  645. (0.95686274509803926, 0.6470588235294118 , 0.50980392156862742),
  646. (0.99215686274509807, 0.85882352941176465, 0.7803921568627451 ),
  647. (0.96862745098039216, 0.96862745098039216, 0.96862745098039216),
  648. (0.81960784313725488, 0.89803921568627454, 0.94117647058823528),
  649. (0.5725490196078431 , 0.77254901960784317, 0.87058823529411766),
  650. (0.2627450980392157 , 0.57647058823529407, 0.76470588235294112),
  651. (0.12941176470588237, 0.4 , 0.67450980392156867),
  652. (0.0196078431372549 , 0.18823529411764706, 0.38039215686274508)
  653. )
  654. _RdGy_data = (
  655. (0.40392156862745099, 0.0 , 0.12156862745098039),
  656. (0.69803921568627447, 0.09411764705882353, 0.16862745098039217),
  657. (0.83921568627450982, 0.37647058823529411, 0.30196078431372547),
  658. (0.95686274509803926, 0.6470588235294118 , 0.50980392156862742),
  659. (0.99215686274509807, 0.85882352941176465, 0.7803921568627451 ),
  660. (1.0 , 1.0 , 1.0 ),
  661. (0.8784313725490196 , 0.8784313725490196 , 0.8784313725490196 ),
  662. (0.72941176470588232, 0.72941176470588232, 0.72941176470588232),
  663. (0.52941176470588236, 0.52941176470588236, 0.52941176470588236),
  664. (0.30196078431372547, 0.30196078431372547, 0.30196078431372547),
  665. (0.10196078431372549, 0.10196078431372549, 0.10196078431372549)
  666. )
  667. _RdPu_data = (
  668. (1.0 , 0.96862745098039216, 0.95294117647058818),
  669. (0.99215686274509807, 0.8784313725490196 , 0.86666666666666667),
  670. (0.9882352941176471 , 0.77254901960784317, 0.75294117647058822),
  671. (0.98039215686274506, 0.62352941176470589, 0.70980392156862748),
  672. (0.96862745098039216, 0.40784313725490196, 0.63137254901960782),
  673. (0.86666666666666667, 0.20392156862745098, 0.59215686274509804),
  674. (0.68235294117647061, 0.00392156862745098, 0.49411764705882355),
  675. (0.47843137254901963, 0.00392156862745098, 0.46666666666666667),
  676. (0.28627450980392155, 0.0 , 0.41568627450980394)
  677. )
  678. _RdYlBu_data = (
  679. (0.6470588235294118 , 0.0 , 0.14901960784313725),
  680. (0.84313725490196079, 0.18823529411764706 , 0.15294117647058825),
  681. (0.95686274509803926, 0.42745098039215684 , 0.2627450980392157 ),
  682. (0.99215686274509807, 0.68235294117647061 , 0.38039215686274508),
  683. (0.99607843137254903, 0.8784313725490196 , 0.56470588235294117),
  684. (1.0 , 1.0 , 0.74901960784313726),
  685. (0.8784313725490196 , 0.95294117647058818 , 0.97254901960784312),
  686. (0.6705882352941176 , 0.85098039215686272 , 0.9137254901960784 ),
  687. (0.45490196078431372, 0.67843137254901964 , 0.81960784313725488),
  688. (0.27058823529411763, 0.45882352941176469 , 0.70588235294117652),
  689. (0.19215686274509805, 0.21176470588235294 , 0.58431372549019611)
  690. )
  691. _RdYlGn_data = (
  692. (0.6470588235294118 , 0.0 , 0.14901960784313725),
  693. (0.84313725490196079, 0.18823529411764706 , 0.15294117647058825),
  694. (0.95686274509803926, 0.42745098039215684 , 0.2627450980392157 ),
  695. (0.99215686274509807, 0.68235294117647061 , 0.38039215686274508),
  696. (0.99607843137254903, 0.8784313725490196 , 0.54509803921568623),
  697. (1.0 , 1.0 , 0.74901960784313726),
  698. (0.85098039215686272, 0.93725490196078431 , 0.54509803921568623),
  699. (0.65098039215686276, 0.85098039215686272 , 0.41568627450980394),
  700. (0.4 , 0.74117647058823533 , 0.38823529411764707),
  701. (0.10196078431372549, 0.59607843137254901 , 0.31372549019607843),
  702. (0.0 , 0.40784313725490196 , 0.21568627450980393)
  703. )
  704. _Reds_data = (
  705. (1.0 , 0.96078431372549022 , 0.94117647058823528),
  706. (0.99607843137254903, 0.8784313725490196 , 0.82352941176470584),
  707. (0.9882352941176471 , 0.73333333333333328 , 0.63137254901960782),
  708. (0.9882352941176471 , 0.5725490196078431 , 0.44705882352941179),
  709. (0.98431372549019602, 0.41568627450980394 , 0.29019607843137257),
  710. (0.93725490196078431, 0.23137254901960785 , 0.17254901960784313),
  711. (0.79607843137254897, 0.094117647058823528, 0.11372549019607843),
  712. (0.6470588235294118 , 0.058823529411764705, 0.08235294117647058),
  713. (0.40392156862745099, 0.0 , 0.05098039215686274)
  714. )
  715. _Spectral_data = (
  716. (0.61960784313725492, 0.003921568627450980, 0.25882352941176473),
  717. (0.83529411764705885, 0.24313725490196078 , 0.30980392156862746),
  718. (0.95686274509803926, 0.42745098039215684 , 0.2627450980392157 ),
  719. (0.99215686274509807, 0.68235294117647061 , 0.38039215686274508),
  720. (0.99607843137254903, 0.8784313725490196 , 0.54509803921568623),
  721. (1.0 , 1.0 , 0.74901960784313726),
  722. (0.90196078431372551, 0.96078431372549022 , 0.59607843137254901),
  723. (0.6705882352941176 , 0.8666666666666667 , 0.64313725490196083),
  724. (0.4 , 0.76078431372549016 , 0.6470588235294118 ),
  725. (0.19607843137254902, 0.53333333333333333 , 0.74117647058823533),
  726. (0.36862745098039218, 0.30980392156862746 , 0.63529411764705879)
  727. )
  728. _YlGn_data = (
  729. (1.0 , 1.0 , 0.89803921568627454),
  730. (0.96862745098039216, 0.9882352941176471 , 0.72549019607843135),
  731. (0.85098039215686272, 0.94117647058823528 , 0.63921568627450975),
  732. (0.67843137254901964, 0.8666666666666667 , 0.55686274509803924),
  733. (0.47058823529411764, 0.77647058823529413 , 0.47450980392156861),
  734. (0.25490196078431371, 0.6705882352941176 , 0.36470588235294116),
  735. (0.13725490196078433, 0.51764705882352946 , 0.2627450980392157 ),
  736. (0.0 , 0.40784313725490196 , 0.21568627450980393),
  737. (0.0 , 0.27058823529411763 , 0.16078431372549021)
  738. )
  739. _YlGnBu_data = (
  740. (1.0 , 1.0 , 0.85098039215686272),
  741. (0.92941176470588238, 0.97254901960784312 , 0.69411764705882351),
  742. (0.7803921568627451 , 0.9137254901960784 , 0.70588235294117652),
  743. (0.49803921568627452, 0.80392156862745101 , 0.73333333333333328),
  744. (0.25490196078431371, 0.71372549019607845 , 0.7686274509803922 ),
  745. (0.11372549019607843, 0.56862745098039214 , 0.75294117647058822),
  746. (0.13333333333333333, 0.36862745098039218 , 0.6588235294117647 ),
  747. (0.14509803921568629, 0.20392156862745098 , 0.58039215686274515),
  748. (0.03137254901960784, 0.11372549019607843 , 0.34509803921568627)
  749. )
  750. _YlOrBr_data = (
  751. (1.0 , 1.0 , 0.89803921568627454),
  752. (1.0 , 0.96862745098039216 , 0.73725490196078436),
  753. (0.99607843137254903, 0.8901960784313725 , 0.56862745098039214),
  754. (0.99607843137254903, 0.7686274509803922 , 0.30980392156862746),
  755. (0.99607843137254903, 0.6 , 0.16078431372549021),
  756. (0.92549019607843142, 0.4392156862745098 , 0.07843137254901961),
  757. (0.8 , 0.29803921568627451 , 0.00784313725490196),
  758. (0.6 , 0.20392156862745098 , 0.01568627450980392),
  759. (0.4 , 0.14509803921568629 , 0.02352941176470588)
  760. )
  761. _YlOrRd_data = (
  762. (1.0 , 1.0 , 0.8 ),
  763. (1.0 , 0.92941176470588238 , 0.62745098039215685),
  764. (0.99607843137254903, 0.85098039215686272 , 0.46274509803921571),
  765. (0.99607843137254903, 0.69803921568627447 , 0.29803921568627451),
  766. (0.99215686274509807, 0.55294117647058827 , 0.23529411764705882),
  767. (0.9882352941176471 , 0.30588235294117649 , 0.16470588235294117),
  768. (0.8901960784313725 , 0.10196078431372549 , 0.10980392156862745),
  769. (0.74117647058823533, 0.0 , 0.14901960784313725),
  770. (0.50196078431372548, 0.0 , 0.14901960784313725)
  771. )
  772. # ColorBrewer's qualitative maps, implemented using ListedColormap
  773. # for use with mpl.colors.NoNorm
  774. _Accent_data = (
  775. (0.49803921568627452, 0.78823529411764703, 0.49803921568627452),
  776. (0.74509803921568629, 0.68235294117647061, 0.83137254901960789),
  777. (0.99215686274509807, 0.75294117647058822, 0.52549019607843139),
  778. (1.0, 1.0, 0.6 ),
  779. (0.2196078431372549, 0.42352941176470588, 0.69019607843137254),
  780. (0.94117647058823528, 0.00784313725490196, 0.49803921568627452),
  781. (0.74901960784313726, 0.35686274509803922, 0.09019607843137254),
  782. (0.4, 0.4, 0.4 ),
  783. )
  784. _Dark2_data = (
  785. (0.10588235294117647, 0.61960784313725492, 0.46666666666666667),
  786. (0.85098039215686272, 0.37254901960784315, 0.00784313725490196),
  787. (0.45882352941176469, 0.4392156862745098, 0.70196078431372544),
  788. (0.90588235294117647, 0.16078431372549021, 0.54117647058823526),
  789. (0.4, 0.65098039215686276, 0.11764705882352941),
  790. (0.90196078431372551, 0.6705882352941176, 0.00784313725490196),
  791. (0.65098039215686276, 0.46274509803921571, 0.11372549019607843),
  792. (0.4, 0.4, 0.4 ),
  793. )
  794. _Paired_data = (
  795. (0.65098039215686276, 0.80784313725490198, 0.8901960784313725 ),
  796. (0.12156862745098039, 0.47058823529411764, 0.70588235294117652),
  797. (0.69803921568627447, 0.87450980392156863, 0.54117647058823526),
  798. (0.2, 0.62745098039215685, 0.17254901960784313),
  799. (0.98431372549019602, 0.60392156862745094, 0.6 ),
  800. (0.8901960784313725, 0.10196078431372549, 0.10980392156862745),
  801. (0.99215686274509807, 0.74901960784313726, 0.43529411764705883),
  802. (1.0, 0.49803921568627452, 0.0 ),
  803. (0.792156862745098, 0.69803921568627447, 0.83921568627450982),
  804. (0.41568627450980394, 0.23921568627450981, 0.60392156862745094),
  805. (1.0, 1.0, 0.6 ),
  806. (0.69411764705882351, 0.34901960784313724, 0.15686274509803921),
  807. )
  808. _Pastel1_data = (
  809. (0.98431372549019602, 0.70588235294117652, 0.68235294117647061),
  810. (0.70196078431372544, 0.80392156862745101, 0.8901960784313725 ),
  811. (0.8, 0.92156862745098034, 0.77254901960784317),
  812. (0.87058823529411766, 0.79607843137254897, 0.89411764705882357),
  813. (0.99607843137254903, 0.85098039215686272, 0.65098039215686276),
  814. (1.0, 1.0, 0.8 ),
  815. (0.89803921568627454, 0.84705882352941175, 0.74117647058823533),
  816. (0.99215686274509807, 0.85490196078431369, 0.92549019607843142),
  817. (0.94901960784313721, 0.94901960784313721, 0.94901960784313721),
  818. )
  819. _Pastel2_data = (
  820. (0.70196078431372544, 0.88627450980392153, 0.80392156862745101),
  821. (0.99215686274509807, 0.80392156862745101, 0.67450980392156867),
  822. (0.79607843137254897, 0.83529411764705885, 0.90980392156862744),
  823. (0.95686274509803926, 0.792156862745098, 0.89411764705882357),
  824. (0.90196078431372551, 0.96078431372549022, 0.78823529411764703),
  825. (1.0, 0.94901960784313721, 0.68235294117647061),
  826. (0.94509803921568625, 0.88627450980392153, 0.8 ),
  827. (0.8, 0.8, 0.8 ),
  828. )
  829. _Set1_data = (
  830. (0.89411764705882357, 0.10196078431372549, 0.10980392156862745),
  831. (0.21568627450980393, 0.49411764705882355, 0.72156862745098038),
  832. (0.30196078431372547, 0.68627450980392157, 0.29019607843137257),
  833. (0.59607843137254901, 0.30588235294117649, 0.63921568627450975),
  834. (1.0, 0.49803921568627452, 0.0 ),
  835. (1.0, 1.0, 0.2 ),
  836. (0.65098039215686276, 0.33725490196078434, 0.15686274509803921),
  837. (0.96862745098039216, 0.50588235294117645, 0.74901960784313726),
  838. (0.6, 0.6, 0.6),
  839. )
  840. _Set2_data = (
  841. (0.4, 0.76078431372549016, 0.6470588235294118 ),
  842. (0.9882352941176471, 0.55294117647058827, 0.3843137254901961 ),
  843. (0.55294117647058827, 0.62745098039215685, 0.79607843137254897),
  844. (0.90588235294117647, 0.54117647058823526, 0.76470588235294112),
  845. (0.65098039215686276, 0.84705882352941175, 0.32941176470588235),
  846. (1.0, 0.85098039215686272, 0.18431372549019609),
  847. (0.89803921568627454, 0.7686274509803922, 0.58039215686274515),
  848. (0.70196078431372544, 0.70196078431372544, 0.70196078431372544),
  849. )
  850. _Set3_data = (
  851. (0.55294117647058827, 0.82745098039215681, 0.7803921568627451 ),
  852. (1.0, 1.0, 0.70196078431372544),
  853. (0.74509803921568629, 0.72941176470588232, 0.85490196078431369),
  854. (0.98431372549019602, 0.50196078431372548, 0.44705882352941179),
  855. (0.50196078431372548, 0.69411764705882351, 0.82745098039215681),
  856. (0.99215686274509807, 0.70588235294117652, 0.3843137254901961 ),
  857. (0.70196078431372544, 0.87058823529411766, 0.41176470588235292),
  858. (0.9882352941176471, 0.80392156862745101, 0.89803921568627454),
  859. (0.85098039215686272, 0.85098039215686272, 0.85098039215686272),
  860. (0.73725490196078436, 0.50196078431372548, 0.74117647058823533),
  861. (0.8, 0.92156862745098034, 0.77254901960784317),
  862. (1.0, 0.92941176470588238, 0.43529411764705883),
  863. )
  864. # The next 7 palettes are from the Yorick scientific visualization package,
  865. # an evolution of the GIST package, both by David H. Munro.
  866. # They are released under a BSD-like license (see LICENSE_YORICK in
  867. # the license directory of the matplotlib source distribution).
  868. #
  869. # Most palette functions have been reduced to simple function descriptions
  870. # by Reinier Heeres, since the rgb components were mostly straight lines.
  871. # gist_earth_data and gist_ncar_data were simplified by a script and some
  872. # manual effort.
  873. _gist_earth_data = \
  874. {'red': (
  875. (0.0, 0.0, 0.0000),
  876. (0.2824, 0.1882, 0.1882),
  877. (0.4588, 0.2714, 0.2714),
  878. (0.5490, 0.4719, 0.4719),
  879. (0.6980, 0.7176, 0.7176),
  880. (0.7882, 0.7553, 0.7553),
  881. (1.0000, 0.9922, 0.9922),
  882. ), 'green': (
  883. (0.0, 0.0, 0.0000),
  884. (0.0275, 0.0000, 0.0000),
  885. (0.1098, 0.1893, 0.1893),
  886. (0.1647, 0.3035, 0.3035),
  887. (0.2078, 0.3841, 0.3841),
  888. (0.2824, 0.5020, 0.5020),
  889. (0.5216, 0.6397, 0.6397),
  890. (0.6980, 0.7171, 0.7171),
  891. (0.7882, 0.6392, 0.6392),
  892. (0.7922, 0.6413, 0.6413),
  893. (0.8000, 0.6447, 0.6447),
  894. (0.8078, 0.6481, 0.6481),
  895. (0.8157, 0.6549, 0.6549),
  896. (0.8667, 0.6991, 0.6991),
  897. (0.8745, 0.7103, 0.7103),
  898. (0.8824, 0.7216, 0.7216),
  899. (0.8902, 0.7323, 0.7323),
  900. (0.8980, 0.7430, 0.7430),
  901. (0.9412, 0.8275, 0.8275),
  902. (0.9569, 0.8635, 0.8635),
  903. (0.9647, 0.8816, 0.8816),
  904. (0.9961, 0.9733, 0.9733),
  905. (1.0000, 0.9843, 0.9843),
  906. ), 'blue': (
  907. (0.0, 0.0, 0.0000),
  908. (0.0039, 0.1684, 0.1684),
  909. (0.0078, 0.2212, 0.2212),
  910. (0.0275, 0.4329, 0.4329),
  911. (0.0314, 0.4549, 0.4549),
  912. (0.2824, 0.5004, 0.5004),
  913. (0.4667, 0.2748, 0.2748),
  914. (0.5451, 0.3205, 0.3205),
  915. (0.7843, 0.3961, 0.3961),
  916. (0.8941, 0.6651, 0.6651),
  917. (1.0000, 0.9843, 0.9843),
  918. )}
  919. _gist_gray_data = {
  920. 'red': gfunc[3],
  921. 'green': gfunc[3],
  922. 'blue': gfunc[3],
  923. }
  924. def _gist_heat_red(x): return 1.5 * x
  925. def _gist_heat_green(x): return 2 * x - 1
  926. def _gist_heat_blue(x): return 4 * x - 3
  927. _gist_heat_data = {
  928. 'red': _gist_heat_red, 'green': _gist_heat_green, 'blue': _gist_heat_blue}
  929. _gist_ncar_data = \
  930. {'red': (
  931. (0.0, 0.0, 0.0000),
  932. (0.3098, 0.0000, 0.0000),
  933. (0.3725, 0.3993, 0.3993),
  934. (0.4235, 0.5003, 0.5003),
  935. (0.5333, 1.0000, 1.0000),
  936. (0.7922, 1.0000, 1.0000),
  937. (0.8471, 0.6218, 0.6218),
  938. (0.8980, 0.9235, 0.9235),
  939. (1.0000, 0.9961, 0.9961),
  940. ), 'green': (
  941. (0.0, 0.0, 0.0000),
  942. (0.0510, 0.3722, 0.3722),
  943. (0.1059, 0.0000, 0.0000),
  944. (0.1569, 0.7202, 0.7202),
  945. (0.1608, 0.7537, 0.7537),
  946. (0.1647, 0.7752, 0.7752),
  947. (0.2157, 1.0000, 1.0000),
  948. (0.2588, 0.9804, 0.9804),
  949. (0.2706, 0.9804, 0.9804),
  950. (0.3176, 1.0000, 1.0000),
  951. (0.3686, 0.8081, 0.8081),
  952. (0.4275, 1.0000, 1.0000),
  953. (0.5216, 1.0000, 1.0000),
  954. (0.6314, 0.7292, 0.7292),
  955. (0.6863, 0.2796, 0.2796),
  956. (0.7451, 0.0000, 0.0000),
  957. (0.7922, 0.0000, 0.0000),
  958. (0.8431, 0.1753, 0.1753),
  959. (0.8980, 0.5000, 0.5000),
  960. (1.0000, 0.9725, 0.9725),
  961. ), 'blue': (
  962. (0.0, 0.5020, 0.5020),
  963. (0.0510, 0.0222, 0.0222),
  964. (0.1098, 1.0000, 1.0000),
  965. (0.2039, 1.0000, 1.0000),
  966. (0.2627, 0.6145, 0.6145),
  967. (0.3216, 0.0000, 0.0000),
  968. (0.4157, 0.0000, 0.0000),
  969. (0.4745, 0.2342, 0.2342),
  970. (0.5333, 0.0000, 0.0000),
  971. (0.5804, 0.0000, 0.0000),
  972. (0.6314, 0.0549, 0.0549),
  973. (0.6902, 0.0000, 0.0000),
  974. (0.7373, 0.0000, 0.0000),
  975. (0.7922, 0.9738, 0.9738),
  976. (0.8000, 1.0000, 1.0000),
  977. (0.8431, 1.0000, 1.0000),
  978. (0.8980, 0.9341, 0.9341),
  979. (1.0000, 0.9961, 0.9961),
  980. )}
  981. _gist_rainbow_data = (
  982. (0.000, (1.00, 0.00, 0.16)),
  983. (0.030, (1.00, 0.00, 0.00)),
  984. (0.215, (1.00, 1.00, 0.00)),
  985. (0.400, (0.00, 1.00, 0.00)),
  986. (0.586, (0.00, 1.00, 1.00)),
  987. (0.770, (0.00, 0.00, 1.00)),
  988. (0.954, (1.00, 0.00, 1.00)),
  989. (1.000, (1.00, 0.00, 0.75))
  990. )
  991. _gist_stern_data = {
  992. 'red': (
  993. (0.000, 0.000, 0.000), (0.0547, 1.000, 1.000),
  994. (0.250, 0.027, 0.250), # (0.2500, 0.250, 0.250),
  995. (1.000, 1.000, 1.000)),
  996. 'green': ((0, 0, 0), (1, 1, 1)),
  997. 'blue': (
  998. (0.000, 0.000, 0.000), (0.500, 1.000, 1.000),
  999. (0.735, 0.000, 0.000), (1.000, 1.000, 1.000))
  1000. }
  1001. def _gist_yarg(x): return 1 - x
  1002. _gist_yarg_data = {'red': _gist_yarg, 'green': _gist_yarg, 'blue': _gist_yarg}
  1003. # This bipolar color map was generated from CoolWarmFloat33.csv of
  1004. # "Diverging Color Maps for Scientific Visualization" by Kenneth Moreland.
  1005. # <http://www.kennethmoreland.com/color-maps/>
  1006. _coolwarm_data = {
  1007. 'red': [
  1008. (0.0, 0.2298057, 0.2298057),
  1009. (0.03125, 0.26623388, 0.26623388),
  1010. (0.0625, 0.30386891, 0.30386891),
  1011. (0.09375, 0.342804478, 0.342804478),
  1012. (0.125, 0.38301334, 0.38301334),
  1013. (0.15625, 0.424369608, 0.424369608),
  1014. (0.1875, 0.46666708, 0.46666708),
  1015. (0.21875, 0.509635204, 0.509635204),
  1016. (0.25, 0.552953156, 0.552953156),
  1017. (0.28125, 0.596262162, 0.596262162),
  1018. (0.3125, 0.639176211, 0.639176211),
  1019. (0.34375, 0.681291281, 0.681291281),
  1020. (0.375, 0.722193294, 0.722193294),
  1021. (0.40625, 0.761464949, 0.761464949),
  1022. (0.4375, 0.798691636, 0.798691636),
  1023. (0.46875, 0.833466556, 0.833466556),
  1024. (0.5, 0.865395197, 0.865395197),
  1025. (0.53125, 0.897787179, 0.897787179),
  1026. (0.5625, 0.924127593, 0.924127593),
  1027. (0.59375, 0.944468518, 0.944468518),
  1028. (0.625, 0.958852946, 0.958852946),
  1029. (0.65625, 0.96732803, 0.96732803),
  1030. (0.6875, 0.969954137, 0.969954137),
  1031. (0.71875, 0.966811177, 0.966811177),
  1032. (0.75, 0.958003065, 0.958003065),
  1033. (0.78125, 0.943660866, 0.943660866),
  1034. (0.8125, 0.923944917, 0.923944917),
  1035. (0.84375, 0.89904617, 0.89904617),
  1036. (0.875, 0.869186849, 0.869186849),
  1037. (0.90625, 0.834620542, 0.834620542),
  1038. (0.9375, 0.795631745, 0.795631745),
  1039. (0.96875, 0.752534934, 0.752534934),
  1040. (1.0, 0.705673158, 0.705673158)],
  1041. 'green': [
  1042. (0.0, 0.298717966, 0.298717966),
  1043. (0.03125, 0.353094838, 0.353094838),
  1044. (0.0625, 0.406535296, 0.406535296),
  1045. (0.09375, 0.458757618, 0.458757618),
  1046. (0.125, 0.50941904, 0.50941904),
  1047. (0.15625, 0.558148092, 0.558148092),
  1048. (0.1875, 0.604562568, 0.604562568),
  1049. (0.21875, 0.648280772, 0.648280772),
  1050. (0.25, 0.688929332, 0.688929332),
  1051. (0.28125, 0.726149107, 0.726149107),
  1052. (0.3125, 0.759599947, 0.759599947),
  1053. (0.34375, 0.788964712, 0.788964712),
  1054. (0.375, 0.813952739, 0.813952739),
  1055. (0.40625, 0.834302879, 0.834302879),
  1056. (0.4375, 0.849786142, 0.849786142),
  1057. (0.46875, 0.860207984, 0.860207984),
  1058. (0.5, 0.86541021, 0.86541021),
  1059. (0.53125, 0.848937047, 0.848937047),
  1060. (0.5625, 0.827384882, 0.827384882),
  1061. (0.59375, 0.800927443, 0.800927443),
  1062. (0.625, 0.769767752, 0.769767752),
  1063. (0.65625, 0.734132809, 0.734132809),
  1064. (0.6875, 0.694266682, 0.694266682),
  1065. (0.71875, 0.650421156, 0.650421156),
  1066. (0.75, 0.602842431, 0.602842431),
  1067. (0.78125, 0.551750968, 0.551750968),
  1068. (0.8125, 0.49730856, 0.49730856),
  1069. (0.84375, 0.439559467, 0.439559467),
  1070. (0.875, 0.378313092, 0.378313092),
  1071. (0.90625, 0.312874446, 0.312874446),
  1072. (0.9375, 0.24128379, 0.24128379),
  1073. (0.96875, 0.157246067, 0.157246067),
  1074. (1.0, 0.01555616, 0.01555616)],
  1075. 'blue': [
  1076. (0.0, 0.753683153, 0.753683153),
  1077. (0.03125, 0.801466763, 0.801466763),
  1078. (0.0625, 0.84495867, 0.84495867),
  1079. (0.09375, 0.883725899, 0.883725899),
  1080. (0.125, 0.917387822, 0.917387822),
  1081. (0.15625, 0.945619588, 0.945619588),
  1082. (0.1875, 0.968154911, 0.968154911),
  1083. (0.21875, 0.98478814, 0.98478814),
  1084. (0.25, 0.995375608, 0.995375608),
  1085. (0.28125, 0.999836203, 0.999836203),
  1086. (0.3125, 0.998151185, 0.998151185),
  1087. (0.34375, 0.990363227, 0.990363227),
  1088. (0.375, 0.976574709, 0.976574709),
  1089. (0.40625, 0.956945269, 0.956945269),
  1090. (0.4375, 0.931688648, 0.931688648),
  1091. (0.46875, 0.901068838, 0.901068838),
  1092. (0.5, 0.865395561, 0.865395561),
  1093. (0.53125, 0.820880546, 0.820880546),
  1094. (0.5625, 0.774508472, 0.774508472),
  1095. (0.59375, 0.726736146, 0.726736146),
  1096. (0.625, 0.678007945, 0.678007945),
  1097. (0.65625, 0.628751763, 0.628751763),
  1098. (0.6875, 0.579375448, 0.579375448),
  1099. (0.71875, 0.530263762, 0.530263762),
  1100. (0.75, 0.481775914, 0.481775914),
  1101. (0.78125, 0.434243684, 0.434243684),
  1102. (0.8125, 0.387970225, 0.387970225),
  1103. (0.84375, 0.343229596, 0.343229596),
  1104. (0.875, 0.300267182, 0.300267182),
  1105. (0.90625, 0.259301199, 0.259301199),
  1106. (0.9375, 0.220525627, 0.220525627),
  1107. (0.96875, 0.184115123, 0.184115123),
  1108. (1.0, 0.150232812, 0.150232812)]
  1109. }
  1110. # Implementation of Carey Rappaport's CMRmap.
  1111. # See `A Color Map for Effective Black-and-White Rendering of Color-Scale
  1112. # Images' by Carey Rappaport
  1113. # http://www.mathworks.com/matlabcentral/fileexchange/2662-cmrmap-m
  1114. _CMRmap_data = {'red': ((0.000, 0.00, 0.00),
  1115. (0.125, 0.15, 0.15),
  1116. (0.250, 0.30, 0.30),
  1117. (0.375, 0.60, 0.60),
  1118. (0.500, 1.00, 1.00),
  1119. (0.625, 0.90, 0.90),
  1120. (0.750, 0.90, 0.90),
  1121. (0.875, 0.90, 0.90),
  1122. (1.000, 1.00, 1.00)),
  1123. 'green': ((0.000, 0.00, 0.00),
  1124. (0.125, 0.15, 0.15),
  1125. (0.250, 0.15, 0.15),
  1126. (0.375, 0.20, 0.20),
  1127. (0.500, 0.25, 0.25),
  1128. (0.625, 0.50, 0.50),
  1129. (0.750, 0.75, 0.75),
  1130. (0.875, 0.90, 0.90),
  1131. (1.000, 1.00, 1.00)),
  1132. 'blue': ((0.000, 0.00, 0.00),
  1133. (0.125, 0.50, 0.50),
  1134. (0.250, 0.75, 0.75),
  1135. (0.375, 0.50, 0.50),
  1136. (0.500, 0.15, 0.15),
  1137. (0.625, 0.00, 0.00),
  1138. (0.750, 0.10, 0.10),
  1139. (0.875, 0.50, 0.50),
  1140. (1.000, 1.00, 1.00))}
  1141. # An MIT licensed, colorblind-friendly heatmap from Wistia:
  1142. # https://github.com/wistia/heatmap-palette
  1143. # http://wistia.com/blog/heatmaps-for-colorblindness
  1144. #
  1145. # >>> import matplotlib.colors as c
  1146. # >>> colors = ["#e4ff7a", "#ffe81a", "#ffbd00", "#ffa000", "#fc7f00"]
  1147. # >>> cm = c.LinearSegmentedColormap.from_list('wistia', colors)
  1148. # >>> _wistia_data = cm._segmentdata
  1149. # >>> del _wistia_data['alpha']
  1150. #
  1151. _wistia_data = {
  1152. 'red': [(0.0, 0.8941176470588236, 0.8941176470588236),
  1153. (0.25, 1.0, 1.0),
  1154. (0.5, 1.0, 1.0),
  1155. (0.75, 1.0, 1.0),
  1156. (1.0, 0.9882352941176471, 0.9882352941176471)],
  1157. 'green': [(0.0, 1.0, 1.0),
  1158. (0.25, 0.9098039215686274, 0.9098039215686274),
  1159. (0.5, 0.7411764705882353, 0.7411764705882353),
  1160. (0.75, 0.6274509803921569, 0.6274509803921569),
  1161. (1.0, 0.4980392156862745, 0.4980392156862745)],
  1162. 'blue': [(0.0, 0.47843137254901963, 0.47843137254901963),
  1163. (0.25, 0.10196078431372549, 0.10196078431372549),
  1164. (0.5, 0.0, 0.0),
  1165. (0.75, 0.0, 0.0),
  1166. (1.0, 0.0, 0.0)],
  1167. }
  1168. # Categorical palettes from Vega:
  1169. # https://github.com/vega/vega/wiki/Scales
  1170. # (divided by 255)
  1171. #
  1172. _tab10_data = (
  1173. (0.12156862745098039, 0.4666666666666667, 0.7058823529411765 ), # 1f77b4
  1174. (1.0, 0.4980392156862745, 0.054901960784313725), # ff7f0e
  1175. (0.17254901960784313, 0.6274509803921569, 0.17254901960784313 ), # 2ca02c
  1176. (0.8392156862745098, 0.15294117647058825, 0.1568627450980392 ), # d62728
  1177. (0.5803921568627451, 0.403921568627451, 0.7411764705882353 ), # 9467bd
  1178. (0.5490196078431373, 0.33725490196078434, 0.29411764705882354 ), # 8c564b
  1179. (0.8901960784313725, 0.4666666666666667, 0.7607843137254902 ), # e377c2
  1180. (0.4980392156862745, 0.4980392156862745, 0.4980392156862745 ), # 7f7f7f
  1181. (0.7372549019607844, 0.7411764705882353, 0.13333333333333333 ), # bcbd22
  1182. (0.09019607843137255, 0.7450980392156863, 0.8117647058823529), # 17becf
  1183. )
  1184. _tab20_data = (
  1185. (0.12156862745098039, 0.4666666666666667, 0.7058823529411765 ), # 1f77b4
  1186. (0.6823529411764706, 0.7803921568627451, 0.9098039215686274 ), # aec7e8
  1187. (1.0, 0.4980392156862745, 0.054901960784313725), # ff7f0e
  1188. (1.0, 0.7333333333333333, 0.47058823529411764 ), # ffbb78
  1189. (0.17254901960784313, 0.6274509803921569, 0.17254901960784313 ), # 2ca02c
  1190. (0.596078431372549, 0.8745098039215686, 0.5411764705882353 ), # 98df8a
  1191. (0.8392156862745098, 0.15294117647058825, 0.1568627450980392 ), # d62728
  1192. (1.0, 0.596078431372549, 0.5882352941176471 ), # ff9896
  1193. (0.5803921568627451, 0.403921568627451, 0.7411764705882353 ), # 9467bd
  1194. (0.7725490196078432, 0.6901960784313725, 0.8352941176470589 ), # c5b0d5
  1195. (0.5490196078431373, 0.33725490196078434, 0.29411764705882354 ), # 8c564b
  1196. (0.7686274509803922, 0.611764705882353, 0.5803921568627451 ), # c49c94
  1197. (0.8901960784313725, 0.4666666666666667, 0.7607843137254902 ), # e377c2
  1198. (0.9686274509803922, 0.7137254901960784, 0.8235294117647058 ), # f7b6d2
  1199. (0.4980392156862745, 0.4980392156862745, 0.4980392156862745 ), # 7f7f7f
  1200. (0.7803921568627451, 0.7803921568627451, 0.7803921568627451 ), # c7c7c7
  1201. (0.7372549019607844, 0.7411764705882353, 0.13333333333333333 ), # bcbd22
  1202. (0.8588235294117647, 0.8588235294117647, 0.5529411764705883 ), # dbdb8d
  1203. (0.09019607843137255, 0.7450980392156863, 0.8117647058823529 ), # 17becf
  1204. (0.6196078431372549, 0.8549019607843137, 0.8980392156862745), # 9edae5
  1205. )
  1206. _tab20b_data = (
  1207. (0.2235294117647059, 0.23137254901960785, 0.4745098039215686 ), # 393b79
  1208. (0.3215686274509804, 0.32941176470588235, 0.6392156862745098 ), # 5254a3
  1209. (0.4196078431372549, 0.43137254901960786, 0.8117647058823529 ), # 6b6ecf
  1210. (0.611764705882353, 0.6196078431372549, 0.8705882352941177 ), # 9c9ede
  1211. (0.38823529411764707, 0.4745098039215686, 0.2235294117647059 ), # 637939
  1212. (0.5490196078431373, 0.6352941176470588, 0.3215686274509804 ), # 8ca252
  1213. (0.7098039215686275, 0.8117647058823529, 0.4196078431372549 ), # b5cf6b
  1214. (0.807843137254902, 0.8588235294117647, 0.611764705882353 ), # cedb9c
  1215. (0.5490196078431373, 0.42745098039215684, 0.19215686274509805), # 8c6d31
  1216. (0.7411764705882353, 0.6196078431372549, 0.2235294117647059 ), # bd9e39
  1217. (0.9058823529411765, 0.7294117647058823, 0.3215686274509804 ), # e7ba52
  1218. (0.9058823529411765, 0.796078431372549, 0.5803921568627451 ), # e7cb94
  1219. (0.5176470588235295, 0.23529411764705882, 0.2235294117647059 ), # 843c39
  1220. (0.6784313725490196, 0.28627450980392155, 0.2901960784313726 ), # ad494a
  1221. (0.8392156862745098, 0.3803921568627451, 0.4196078431372549 ), # d6616b
  1222. (0.9058823529411765, 0.5882352941176471, 0.611764705882353 ), # e7969c
  1223. (0.4823529411764706, 0.2549019607843137, 0.45098039215686275), # 7b4173
  1224. (0.6470588235294118, 0.3176470588235294, 0.5803921568627451 ), # a55194
  1225. (0.807843137254902, 0.42745098039215684, 0.7411764705882353 ), # ce6dbd
  1226. (0.8705882352941177, 0.6196078431372549, 0.8392156862745098 ), # de9ed6
  1227. )
  1228. _tab20c_data = (
  1229. (0.19215686274509805, 0.5098039215686274, 0.7411764705882353 ), # 3182bd
  1230. (0.4196078431372549, 0.6823529411764706, 0.8392156862745098 ), # 6baed6
  1231. (0.6196078431372549, 0.792156862745098, 0.8823529411764706 ), # 9ecae1
  1232. (0.7764705882352941, 0.8588235294117647, 0.9372549019607843 ), # c6dbef
  1233. (0.9019607843137255, 0.3333333333333333, 0.050980392156862744), # e6550d
  1234. (0.9921568627450981, 0.5529411764705883, 0.23529411764705882 ), # fd8d3c
  1235. (0.9921568627450981, 0.6823529411764706, 0.4196078431372549 ), # fdae6b
  1236. (0.9921568627450981, 0.8156862745098039, 0.6352941176470588 ), # fdd0a2
  1237. (0.19215686274509805, 0.6392156862745098, 0.32941176470588235 ), # 31a354
  1238. (0.4549019607843137, 0.7686274509803922, 0.4627450980392157 ), # 74c476
  1239. (0.6313725490196078, 0.8509803921568627, 0.6078431372549019 ), # a1d99b
  1240. (0.7803921568627451, 0.9137254901960784, 0.7529411764705882 ), # c7e9c0
  1241. (0.4588235294117647, 0.4196078431372549, 0.6941176470588235 ), # 756bb1
  1242. (0.6196078431372549, 0.6039215686274509, 0.7843137254901961 ), # 9e9ac8
  1243. (0.7372549019607844, 0.7411764705882353, 0.8627450980392157 ), # bcbddc
  1244. (0.8549019607843137, 0.8549019607843137, 0.9215686274509803 ), # dadaeb
  1245. (0.38823529411764707, 0.38823529411764707, 0.38823529411764707 ), # 636363
  1246. (0.5882352941176471, 0.5882352941176471, 0.5882352941176471 ), # 969696
  1247. (0.7411764705882353, 0.7411764705882353, 0.7411764705882353 ), # bdbdbd
  1248. (0.8509803921568627, 0.8509803921568627, 0.8509803921568627 ), # d9d9d9
  1249. )
  1250. datad = {
  1251. 'Blues': _Blues_data,
  1252. 'BrBG': _BrBG_data,
  1253. 'BuGn': _BuGn_data,
  1254. 'BuPu': _BuPu_data,
  1255. 'CMRmap': _CMRmap_data,
  1256. 'GnBu': _GnBu_data,
  1257. 'Greens': _Greens_data,
  1258. 'Greys': _Greys_data,
  1259. 'OrRd': _OrRd_data,
  1260. 'Oranges': _Oranges_data,
  1261. 'PRGn': _PRGn_data,
  1262. 'PiYG': _PiYG_data,
  1263. 'PuBu': _PuBu_data,
  1264. 'PuBuGn': _PuBuGn_data,
  1265. 'PuOr': _PuOr_data,
  1266. 'PuRd': _PuRd_data,
  1267. 'Purples': _Purples_data,
  1268. 'RdBu': _RdBu_data,
  1269. 'RdGy': _RdGy_data,
  1270. 'RdPu': _RdPu_data,
  1271. 'RdYlBu': _RdYlBu_data,
  1272. 'RdYlGn': _RdYlGn_data,
  1273. 'Reds': _Reds_data,
  1274. 'Spectral': _Spectral_data,
  1275. 'Wistia': _wistia_data,
  1276. 'YlGn': _YlGn_data,
  1277. 'YlGnBu': _YlGnBu_data,
  1278. 'YlOrBr': _YlOrBr_data,
  1279. 'YlOrRd': _YlOrRd_data,
  1280. 'afmhot': _afmhot_data,
  1281. 'autumn': _autumn_data,
  1282. 'binary': _binary_data,
  1283. 'bone': _bone_data,
  1284. 'brg': _brg_data,
  1285. 'bwr': _bwr_data,
  1286. 'cool': _cool_data,
  1287. 'coolwarm': _coolwarm_data,
  1288. 'copper': _copper_data,
  1289. 'cubehelix': _cubehelix_data,
  1290. 'flag': _flag_data,
  1291. 'gist_earth': _gist_earth_data,
  1292. 'gist_gray': _gist_gray_data,
  1293. 'gist_heat': _gist_heat_data,
  1294. 'gist_ncar': _gist_ncar_data,
  1295. 'gist_rainbow': _gist_rainbow_data,
  1296. 'gist_stern': _gist_stern_data,
  1297. 'gist_yarg': _gist_yarg_data,
  1298. 'gnuplot': _gnuplot_data,
  1299. 'gnuplot2': _gnuplot2_data,
  1300. 'gray': _gray_data,
  1301. 'hot': _hot_data,
  1302. 'hsv': _hsv_data,
  1303. 'jet': _jet_data,
  1304. 'nipy_spectral': _nipy_spectral_data,
  1305. 'ocean': _ocean_data,
  1306. 'pink': _pink_data,
  1307. 'prism': _prism_data,
  1308. 'rainbow': _rainbow_data,
  1309. 'seismic': _seismic_data,
  1310. 'spring': _spring_data,
  1311. 'summer': _summer_data,
  1312. 'terrain': _terrain_data,
  1313. 'winter': _winter_data,
  1314. # Qualitative
  1315. 'Accent': {'listed': _Accent_data},
  1316. 'Dark2': {'listed': _Dark2_data},
  1317. 'Paired': {'listed': _Paired_data},
  1318. 'Pastel1': {'listed': _Pastel1_data},
  1319. 'Pastel2': {'listed': _Pastel2_data},
  1320. 'Set1': {'listed': _Set1_data},
  1321. 'Set2': {'listed': _Set2_data},
  1322. 'Set3': {'listed': _Set3_data},
  1323. 'tab10': {'listed': _tab10_data},
  1324. 'tab20': {'listed': _tab20_data},
  1325. 'tab20b': {'listed': _tab20b_data},
  1326. 'tab20c': {'listed': _tab20c_data},
  1327. }