Skip to content

Commit 46bfafe

Browse files
authoredJan 11, 2019
Merge pull request #74 from kthyng/master
Updating cmocean to version 2.0
2 parents ebdb281 + fee2c2a commit 46bfafe

16 files changed

+1646
-127
lines changed
 

‎.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
cmocean/rgb/drafts/
12
dist
23
*.pyc
34
.DS_STORE
@@ -8,4 +9,5 @@ figures/eval*
89
figures/gallery*
910
.pytest_cache/*
1011
docs/build/*
12+
build
1113
figures/lightness*

‎MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include README.rst
1+
include README.md
22
include *.txt
33
recursive-include cmocean *.txt
44
recursive-include cmocean *.py

‎cmocean/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717

1818
__authors__ = ['Kristen Thyng <kthyng@tamu.edu>']
1919

20-
__version__ = "1.2"
20+
__version__ = "2.0"

‎cmocean/cm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# List of colormap names
2323
cmapnames = ['thermal', 'haline', 'solar', 'ice', 'gray', 'oxy', 'deep',
2424
'dense', 'algae', 'matter', 'turbid', 'speed', 'amp', 'tempo',
25-
'phase', 'balance', 'delta', 'curl']
25+
'rain', 'phase', 'topo', 'balance', 'delta', 'curl', 'diff', 'tarn']
2626

2727
# initialize dictionary to contain colormaps
2828
cmap_d = dict()

‎cmocean/plots.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ def plot_lightness(saveplot=False):
2222
x = np.linspace(0.0, 1.0, 256)
2323
locs = [] # locations for text labels
2424

25-
fig = plt.figure(figsize=(16, 6))
25+
fig = plt.figure(figsize=(16, 5))
2626
ax = fig.add_subplot(111)
27+
fig.subplots_adjust(left=0.03, right=0.97)
2728
ax.set_xlim(-0.1, len(cm.cmap_d)/2. + 0.1)
2829
ax.set_ylim(0, 100)
2930
ax.set_xlabel('Lightness for each colormap', fontsize=14)
@@ -38,9 +39,9 @@ def plot_lightness(saveplot=False):
3839
lab = cspace_converter("sRGB1", "CAM02-UCS")(rgb)
3940
L = lab[0, :, 0]
4041
if L[-1] > L[0]:
41-
ax.scatter(x+j*dc, L, c=x, cmap=cmap, s=300, linewidths=0.)
42+
ax.scatter(x+j*dc, L, c=x, cmap=cmap, s=200, linewidths=0.)
4243
else:
43-
ax.scatter(x+j*dc, L[::-1], c=x[::-1], cmap=cmap, s=300, linewidths=0.)
44+
ax.scatter(x+j*dc, L[::-1], c=x[::-1], cmap=cmap, s=200, linewidths=0.)
4445
locs.append(x[-1]+j*dc) # store locations for colormap labels
4546

4647
# Set up labels for colormaps

‎cmocean/rgb/diff-rgb.txt

+256
Large diffs are not rendered by default.

‎cmocean/rgb/diff.jscm

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"content-type": "application/vnd.matplotlib.colormap-v1+json",
3+
"name": "rain_anomaly3b",
4+
"license": "http://creativecommons.org/publicdomain/zero/1.0/",
5+
"usage-hints": [
6+
"red-green-colorblind-safe",
7+
"greyscale-safe",
8+
"diverging"
9+
],
10+
"colorspace": "sRGB",
11+
"domain": "continuous",
12+
"colors": "0823400925420a26440b28450c2a470c2c490d2d4b0e2f4d0f314f103251113453113655123756133958143b5a143d5c153e5e16405f1742611843631945641a47661b48671d4a681f4c69214d6a244f6b26506c28526d2b536e2d556f2f5670315871345973365b74385c753a5e763c5f773e617841627943647a45657b47677d49687e4b6a7f4d6b804f6d81516e825370845571855873865a74875c76885e788a60798b627b8c647c8d667e8e687f906a81916c82926e8494708695728796748997768a99788c9a7b8d9b7d8f9d7f919e81929f8394a18596a28797a38999a58b9aa68d9ca78f9ea9929faa94a1ac96a3ad98a5af9aa6b09ca8b19eaab3a0abb4a3adb6a5afb7a7b1b9a9b2baabb4bcaeb6bdb0b8bfb2bac0b4bbc2b6bdc4b9bfc5bbc1c7bdc3c8bfc5cac2c6ccc4c8cdc6cacfc8ccd1cbced2cdd0d4cfd2d6d2d4d7d4d6d9d6d8dbd9dadddbdcdedddee0e0e0e2e2e2e3e4e3e5e6e5e7e8e7e8ebe9eaeceaebeeececf0edeef1eeeff3efeff4f0f0f5f1f0f5f1f0f6f1f0f6f1f0f5f1eff5f0eef4efedf3eeebf2ede9f1ebe8efeae5eee8e3ece6e1eae5dfe8e3dce7e1dae5dfd7e3ddd4e1dbd2dfd9cfddd7cddbd5cad9d3c7d7d1c5d5cfc2d3cdc0d2cbbdd0c9bbcec7b8ccc5b5cac3b3c8c1b0c7bfaec5bdabc3bba9c1b9a6bfb7a4beb5a1bcb39fbab19db9b09ab7ae98b5ac95b3aa93b2a890b0a68eaea58cada389aba187a99f85a89d82a69c80a49a7da3987ba19679a095769e93749c91729b8f70998e6d988c6b968a699589679387649185629084608e825e8d805b8b7f598a7d57887b55877a5385785083764e82754c80734a7f72487d70467c6e437a6d41796b3f776a3d76683b7466397265377163356f62336e60306c5f2e6a5d2c685c2b675a296559276358266156255f55245d54235b5222595121574f20554e20534d1f514b1e4f4a1d4d481d4b471c49451b47441a45431a434119424018403e173e3d163c3b163a3a153839143637133436123334123133112f31102d300f2b2e0e292d0d272b0c262a0b24280a2227092025091e24081c2207",
13+
"extensions": {
14+
"https://matplotlib.org/viscm": {
15+
"min_Jp": 100,
16+
"max_Jp": 15,
17+
"xp": [
18+
-1.7830585235845149,
19+
-13.024664298219903,
20+
0,
21+
0.3397407516725792,
22+
-5.3330392945219955
23+
],
24+
"yp": [
25+
-13.994320030766502,
26+
-18.431795994438367,
27+
0,
28+
18.939393939393938,
29+
10.855545365795933
30+
],
31+
"fixed": 2,
32+
"filter_k": 25.644840365177174,
33+
"cmtype": "diverging",
34+
"uniform_colorspace": "CAM02-UCS",
35+
"spline_method": "CatmulClark"
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)