kplot 1.1.35__tar.gz → 1.1.37__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kplot-1.1.35 → kplot-1.1.37}/PKG-INFO +1 -1
- {kplot-1.1.35 → kplot-1.1.37}/pyproject.toml +1 -1
- {kplot-1.1.35 → kplot-1.1.37}/src/kplot/cmaps.py +5 -2
- {kplot-1.1.35 → kplot-1.1.37}/README.md +0 -0
- {kplot-1.1.35 → kplot-1.1.37}/src/kplot/__init__.py +0 -0
- {kplot-1.1.35 → kplot-1.1.37}/src/kplot/axes.py +0 -0
- {kplot-1.1.35 → kplot-1.1.37}/src/kplot/image.py +0 -0
- {kplot-1.1.35 → kplot-1.1.37}/src/kplot/movie.py +0 -0
- {kplot-1.1.35 → kplot-1.1.37}/src/kplot/plot.py +0 -0
- {kplot-1.1.35 → kplot-1.1.37}/src/kplot/styles/example.mpl +0 -0
- {kplot-1.1.35 → kplot-1.1.37}/src/kplot/styles/publication.mpl +0 -0
- {kplot-1.1.35 → kplot-1.1.37}/src/kplot/threeD/__init__.py +0 -0
- {kplot-1.1.35 → kplot-1.1.37}/src/kplot/threeD/slider_images.py +0 -0
- {kplot-1.1.35 → kplot-1.1.37}/src/kplot/utils.py +0 -0
|
@@ -5,9 +5,10 @@ from kbasic.typing import Number, Array
|
|
|
5
5
|
from collections.abc import Iterable
|
|
6
6
|
from typing import Optional
|
|
7
7
|
from matplotlib.pyplot import cm, gca
|
|
8
|
+
from matplotlib.cm import ScalarMappable
|
|
8
9
|
from matplotlib.colors import Colormap, LinearSegmentedColormap, ListedColormap, \
|
|
9
10
|
hex2color, Normalize, LogNorm, FuncNorm, AsinhNorm, PowerNorm, SymLogNorm, \
|
|
10
|
-
BoundaryNorm, CenteredNorm, TwoSlopeNorm
|
|
11
|
+
BoundaryNorm, CenteredNorm, TwoSlopeNorm
|
|
11
12
|
from matplotlib.axes_grid1 import make_axes_locatable
|
|
12
13
|
from matplotlib.axes import Axes
|
|
13
14
|
from numpy import uint8, zeros, ndarray, inf, nanmin, nanmax, nanquantile, nanmean, \
|
|
@@ -84,7 +85,9 @@ def parse_color(
|
|
|
84
85
|
"""docstring"""
|
|
85
86
|
match color:
|
|
86
87
|
# given an rgb(a)
|
|
87
|
-
case (
|
|
88
|
+
case (r, g, b) if all(type(x) in Number.types for x in color):
|
|
89
|
+
return color
|
|
90
|
+
case (r, g, b, a) if all(type(x) in Number.types for x in color):
|
|
88
91
|
return color
|
|
89
92
|
# otherwise assume arrays of numbers want to be color-mapped
|
|
90
93
|
case x if type(color) in Array.types and type(color[0]) in Number.types:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|