_cm.py 65 KB

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