Skip to content

Commit

Permalink
Merge branch 'master' into to-3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
callumrollo committed Jan 30, 2021
2 parents fd3f1a2 + d3ed6d0 commit 515c1c7
Show file tree
Hide file tree
Showing 21 changed files with 1,617 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ __pycache__
.idea
dist
cmcrameri.egg-info
venv
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
[![Python 3.7](https://img.shields.io/badge/python-3.7-blue.svg)]()
[![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)]()

[![Downloads](https://pepy.tech/badge/cmcrameri)](https://pepy.tech/project/cmcrameri)
[![Downloads](https://pepy.tech/badge/cmcrameri)](https://pepy.tech/project/cmcrameri) (PyPI)

[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/cmcrameri.svg)](https://anaconda.org/conda-forge/cmcrameri) (conda-forge)

# cmcrameri

Expand Down
10 changes: 7 additions & 3 deletions cmcrameri/cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@
paths = list(Path(text_file_folder).glob('*.txt'))
crameri_cmaps = dict()
crameri_cmaps_r = dict()
crameri_cmaps_s = dict()
for cmap_path in paths:
# Name of colour map taken from text file
cmap_name = os.path.split(cmap_path)[1][:-4]
cm_data = np.loadtxt(cmap_path)
cm_data = np.loadtxt(str(cmap_path))
# Make a linear segmented colour map
if cmap_name[-1] == 'S':
crameri_cmaps_s[cmap_name] = LinearSegmentedColormap.from_list(cmap_name, cm_data)
continue
crameri_cmaps[cmap_name] = LinearSegmentedColormap.from_list(cmap_name, cm_data)
# reverse the colour map and add this to the dictionary crameri_cmaps_r
# reverse the colour map and add this to the dictionary crameri_cmaps_r, mpt fpr categorical maps
crameri_cmaps_r[cmap_name + '_r'] = LinearSegmentedColormap.from_list(cmap_name + '_r', cm_data[::-1, :])


Expand All @@ -43,9 +47,9 @@ def show_cmaps():
colourmap = crameri_cmaps[cmap_selected]
axs[c].pcolor(x, cmap=colourmap)
axs[c].text(5, -0.3, cmap_selected, fontsize=30)
# plt.savefig('colormaps')


# So colourmaps can be called in other programs
locals().update(crameri_cmaps)
locals().update(crameri_cmaps_r)
locals().update(crameri_cmaps_s)
100 changes: 100 additions & 0 deletions cmcrameri/cmaps/actonS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
0.180627 0.129916 0.300244
0.900472 0.900123 0.940051
0.763197 0.428302 0.605491
0.829539 0.652496 0.769411
0.467788 0.351091 0.523965
0.312311 0.244675 0.416090
0.834181 0.547106 0.694028
0.854249 0.771471 0.852124
0.619634 0.396704 0.574463
0.876275 0.835142 0.895733
0.244814 0.186502 0.357622
0.830274 0.599067 0.731464
0.688751 0.403316 0.583686
0.821153 0.487856 0.650671
0.386314 0.301752 0.473581
0.837653 0.710145 0.809754
0.544933 0.382041 0.556844
0.832581 0.573311 0.712971
0.797645 0.455528 0.626525
0.832413 0.680782 0.789286
0.831962 0.519007 0.673568
0.277979 0.215505 0.386769
0.348325 0.273673 0.445226
0.888274 0.867515 0.917827
0.426337 0.327992 0.500233
0.212499 0.157916 0.328752
0.828962 0.625307 0.750172
0.864804 0.803086 0.873811
0.725160 0.411292 0.591407
0.654185 0.399779 0.579086
0.845051 0.740430 0.830738
0.583458 0.391391 0.567579
0.509444 0.369805 0.543590
0.637028 0.398390 0.576941
0.367058 0.287868 0.459557
0.744169 0.418444 0.597513
0.811068 0.471522 0.638538
0.294964 0.230077 0.401431
0.831389 0.586173 0.722221
0.446951 0.340021 0.512544
0.706646 0.406448 0.586932
0.829424 0.612085 0.740764
0.488682 0.361046 0.534347
0.601814 0.394456 0.571418
0.830678 0.666500 0.779269
0.564500 0.387290 0.562768
0.859387 0.787218 0.862937
0.894368 0.883797 0.928919
0.834745 0.695339 0.799452
0.671339 0.401281 0.581210
0.833624 0.560346 0.703619
0.228599 0.172138 0.343143
0.870449 0.819064 0.884748
0.849455 0.755867 0.841386
0.841101 0.725185 0.820185
0.330097 0.259251 0.430713
0.827958 0.503800 0.662432
0.196548 0.143832 0.314443
0.781382 0.440823 0.615295
0.406106 0.315187 0.487202
0.261278 0.200942 0.372155
0.828980 0.638770 0.759714
0.882230 0.851290 0.906760
0.833814 0.533389 0.684062
0.529895 0.377288 0.551623
0.833139 0.566852 0.708319
0.220543 0.164997 0.335928
0.269603 0.208226 0.379461
0.592717 0.393035 0.569606
0.816539 0.479697 0.644622
0.830808 0.592613 0.726841
0.679991 0.402185 0.582378
0.843016 0.732783 0.825446
0.829189 0.645596 0.764546
0.891315 0.875649 0.923371
0.789819 0.447951 0.620776
0.519714 0.373712 0.547758
0.303592 0.237416 0.408762
0.834145 0.540322 0.689113
0.836126 0.702712 0.804586
0.662752 0.400504 0.580132
0.286418 0.222807 0.394097
0.478238 0.356221 0.529300
0.357638 0.280787 0.452429
0.554790 0.384818 0.559949
0.734623 0.414551 0.594233
0.830272 0.511501 0.668084
0.753728 0.423021 0.601262
0.867604 0.811065 0.879271
0.824942 0.495898 0.656621
0.879238 0.843207 0.901240
0.829807 0.605550 0.736101
0.885244 0.859397 0.912287
0.416168 0.321674 0.493799
0.829138 0.618676 0.745453
0.457349 0.345672 0.518381
0.828906 0.632008 0.754931
0.830034 0.659466 0.774318
0.236700 0.179309 0.350370
0.436612 0.334121 0.506490
100 changes: 100 additions & 0 deletions cmcrameri/cmaps/bamakoS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
0.001175 0.250044 0.300000
0.999903 0.899882 0.599947
0.376382 0.490337 0.080686
0.725880 0.647397 0.145035
0.167053 0.354889 0.202479
0.889582 0.789052 0.380980
0.084163 0.299722 0.253651
0.530877 0.558348 0.010839
0.259543 0.415165 0.147333
0.044597 0.274322 0.277340
0.449245 0.532071 0.039697
0.619542 0.582679 0.046299
0.314258 0.450539 0.115679
0.124158 0.326529 0.228728
0.821416 0.724823 0.263607
0.946034 0.845350 0.491688
0.210008 0.383003 0.176605
0.411203 0.511641 0.061172
0.103840 0.312940 0.241344
0.286111 0.432382 0.131850
0.671795 0.610568 0.092200
0.145276 0.340514 0.215777
0.858179 0.758596 0.323333
0.234233 0.398752 0.162241
0.973179 0.872677 0.545938
0.064737 0.286842 0.265642
0.777025 0.687087 0.203085
0.022743 0.262082 0.288777
0.489820 0.548275 0.020312
0.572854 0.566844 0.016927
0.918353 0.817635 0.436863
0.344219 0.469841 0.098693
0.189589 0.369663 0.188866
0.645137 0.595166 0.068288
0.551529 0.562255 0.011649
0.959662 0.859041 0.518860
0.113913 0.319699 0.235086
0.698910 0.628247 0.117832
0.156069 0.347650 0.209167
0.054846 0.280535 0.271512
0.469349 0.540915 0.028957
0.329005 0.460030 0.107308
0.360001 0.479944 0.089849
0.595411 0.573356 0.028014
0.840659 0.742207 0.293686
0.221986 0.390806 0.169504
0.510378 0.553974 0.014132
0.272646 0.423655 0.139630
0.904169 0.803498 0.409089
0.874359 0.774139 0.352412
0.093906 0.306298 0.247540
0.393410 0.500954 0.071224
0.299981 0.441323 0.123822
0.246728 0.406871 0.154836
0.932278 0.831569 0.464376
0.074435 0.293235 0.259690
0.134649 0.333485 0.222278
0.012175 0.256038 0.294402
0.986594 0.886282 0.572957
0.752096 0.667240 0.173524
0.178238 0.362218 0.195717
0.429814 0.522143 0.050712
0.800210 0.706402 0.233246
0.033437 0.268163 0.283091
0.201156 0.377240 0.181885
0.139884 0.336985 0.219039
0.069647 0.290030 0.262671
0.079232 0.296472 0.256672
0.039136 0.271239 0.280209
0.321563 0.455253 0.111528
0.384799 0.495619 0.075955
0.279354 0.427992 0.135746
0.788855 0.696837 0.218132
0.583945 0.569784 0.021653
0.811064 0.715739 0.248452
0.952864 0.852210 0.505275
0.979899 0.879477 0.559448
0.129375 0.330003 0.225511
0.098845 0.309614 0.244430
0.658372 0.602535 0.079969
0.059903 0.283690 0.268596
0.439428 0.527215 0.045272
0.459225 0.536663 0.034001
0.882069 0.781666 0.366759
0.368109 0.485098 0.085276
0.266059 0.419392 0.143520
0.632175 0.588528 0.057023
0.739120 0.657282 0.159119
0.402200 0.506297 0.066264
0.228091 0.394757 0.165848
0.108845 0.316315 0.238209
0.520629 0.556283 0.012180
0.183870 0.365930 0.192298
0.017450 0.259071 0.291607
0.831274 0.733644 0.278697
0.195352 0.373435 0.185419
0.352037 0.474856 0.094325
0.712448 0.637686 0.131249
0.253098 0.410998 0.151093
0.849615 0.750519 0.308586
100 changes: 100 additions & 0 deletions cmcrameri/cmaps/batlowS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
0.005193 0.098238 0.349842
0.981354 0.800406 0.981267
0.511253 0.510898 0.193296
0.133298 0.375282 0.379395
0.946612 0.614218 0.419767
0.302379 0.450282 0.300122
0.066899 0.263188 0.377594
0.992900 0.704852 0.704114
0.754268 0.565033 0.211761
0.088353 0.322167 0.384731
0.989089 0.750968 0.837979
0.987567 0.658422 0.566226
0.209075 0.417412 0.349677
0.049378 0.191076 0.365810
0.631513 0.540752 0.170075
0.402968 0.480466 0.244731
0.865168 0.585882 0.302255
0.032053 0.146774 0.358239
0.992595 0.681914 0.636869
0.985980 0.775272 0.908448
0.693720 0.553797 0.182610
0.811692 0.575187 0.252572
0.570016 0.526186 0.175273
0.167952 0.397889 0.367784
0.455774 0.495585 0.217774
0.075833 0.293321 0.381922
0.973424 0.635183 0.492547
0.059164 0.229842 0.372252
0.254452 0.434529 0.326434
0.106842 0.349774 0.384548
0.991367 0.727614 0.770270
0.351976 0.465440 0.272492
0.912746 0.599191 0.360986
0.377291 0.472952 0.258588
0.278171 0.442524 0.313552
0.981918 0.646664 0.529602
0.990926 0.670230 0.602031
0.081553 0.307858 0.383598
0.483123 0.503216 0.205037
0.429094 0.488011 0.231096
0.783416 0.570162 0.230962
0.889900 0.592087 0.330454
0.961696 0.624282 0.455702
0.096618 0.336161 0.385134
0.724322 0.559628 0.195408
0.662691 0.547503 0.174044
0.054721 0.211234 0.369184
0.063071 0.247085 0.375050
0.327007 0.457900 0.286377
0.983913 0.787757 0.944626
0.149706 0.386975 0.374449
0.600520 0.533605 0.170648
0.071115 0.278497 0.379895
0.992258 0.716210 0.737146
0.118992 0.362849 0.382713
0.540225 0.518584 0.183099
0.993111 0.693451 0.670810
0.987672 0.762996 0.872864
0.990307 0.739184 0.803810
0.187886 0.408003 0.359484
0.019936 0.122985 0.354120
0.042104 0.169557 0.362151
0.231362 0.426197 0.338572
0.838999 0.580339 0.276353
0.928323 0.605212 0.385404
0.266241 0.438555 0.320085
0.092304 0.329220 0.385040
0.141260 0.381240 0.377135
0.739393 0.562386 0.203179
0.469368 0.499393 0.211318
0.290214 0.446420 0.306889
0.992967 0.687705 0.653934
0.678244 0.550712 0.177803
0.615972 0.537231 0.169826
0.989720 0.745039 0.820804
0.158620 0.392531 0.371320
0.967983 0.629639 0.474057
0.954574 0.619137 0.437582
0.314648 0.454107 0.293279
0.585199 0.529927 0.172493
0.045905 0.180460 0.364007
0.037449 0.158313 0.360216
0.555024 0.522391 0.178854
0.989496 0.664329 0.584246
0.986868 0.769105 0.890573
0.064936 0.255264 0.376362
0.647098 0.544183 0.171465
0.415967 0.484225 0.237895
0.012963 0.110779 0.351992
0.220112 0.421864 0.344261
0.078517 0.300622 0.382814
0.991935 0.676091 0.619575
0.198310 0.412798 0.354767
0.709098 0.556772 0.188546
0.073440 0.285942 0.380957
0.825472 0.577725 0.264197
0.125889 0.369160 0.381259
0.901590 0.595507 0.345429
0.937850 0.609582 0.402345
0.985066 0.652522 0.547998
Loading

0 comments on commit 515c1c7

Please sign in to comment.