Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 896d089

Browse files
committed
Merge pull request #5611 from kthyng/update-colormap-user-page
Update colormap user page
1 parent e74ae79 commit 896d089

3 files changed

Lines changed: 3 additions & 185 deletions

File tree

doc/users/colormaps.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,6 @@ extension on this idea at [mycarta-jet]_.
126126

127127
.. plot:: users/plotting/colormaps/lightness.py
128128

129-
130-
:math:`L^*` function
131-
====================
132-
133-
There are multiple approaches to finding the best function for :math:`L^*`
134-
across a colormap. Linear gives reasonable results (*e.g.*, [mycarta-banding]_,
135-
[mycarta-lablinear]_). However, the Weber-Fechner law, and more generally and
136-
recently, Stevens' Law, indicates that a logarithmic or geometric relationship
137-
might be better (see effort on this front at [mycarta-cubelaw]_).
138-
139-
.. plot:: users/plotting/colormaps/Lfunction.py
140-
141-
142129
Grayscale conversion
143130
====================
144131

doc/users/plotting/colormaps/Lfunction.py

Lines changed: 0 additions & 168 deletions
This file was deleted.

doc/users/plotting/colormaps/grayscale.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
Uses lightness L* as a proxy for grayscale value.
44
'''
55

6-
import colorconv as color
7-
86
from colormaps import cmaps
97

108
#from skimage import color
@@ -14,6 +12,7 @@
1412
import matplotlib.pyplot as plt
1513
from matplotlib import cm
1614
import matplotlib as mpl
15+
from colorspacious import cspace_converter
1716

1817
mpl.rcParams.update({'font.size': 14})
1918
mpl.rcParams['font.sans-serif'] = ('Arev Sans, Bitstream Vera Sans, '
@@ -48,8 +47,8 @@ def plot_color_gradients(cmap_category, cmap_list):
4847
# Get rgb values for colormap
4948
rgb = cm.get_cmap(plt.get_cmap(name))(x)[np.newaxis,:,:3]
5049

51-
# Get colormap in CIE LAB. We want the L here.
52-
lab = color.rgb2lab(rgb)
50+
# Get colormap in CAM02-UCS colorspace. We want the lightness.
51+
lab = cspace_converter("sRGB1", "CAM02-UCS")(rgb)
5352
L = lab[0,:,0]
5453
L = np.float32(np.vstack((L, L, L)))
5554

0 commit comments

Comments
 (0)