|
4 | 4 | from matplotlib import pyplot as plt
|
5 | 5 | from matplotlib.colors import LinearSegmentedColormap as lscmap
|
6 | 6 | from matplotlib import animation
|
7 |
| -from itertools import cycle |
8 |
| -import matplotlib.colors as mcolors |
9 | 7 | import pyvista as pv
|
10 | 8 | from typing import Any, Callable
|
11 |
| -import sme |
12 | 9 |
|
13 | 10 | from .pyvista_utils import (
|
14 | 11 | find_layout,
|
@@ -37,28 +34,6 @@ def colormap(color, name="my colormap"):
|
37 | 34 | return lscmap.from_list(name, [(0, 0, 0), color], 256)
|
38 | 35 |
|
39 | 36 |
|
40 |
| -def make_circular_colormap( |
41 |
| - cmap: str = "tab10", values: np.ndarray = np.array([]) |
42 |
| -) -> list[tuple]: |
43 |
| - """Create a discrete colormap of potentially repeating colors of the same size as the `values` array. |
44 |
| -
|
45 |
| - Args: |
46 |
| - cmap (str, optional): matplotlib colormap name. Defaults to "tab10". |
47 |
| - values (np.array, optional): values to be mapped to colors. Defaults to []. |
48 |
| -
|
49 |
| - Returns: |
50 |
| - list[tuple]: list of color in rgba format. |
51 |
| - """ |
52 |
| - cm = [(0.0, 0.0, 0.0, 1.0)] |
53 |
| - i = 0 |
54 |
| - for c in cycle(plt.get_cmap(cmap).colors): |
55 |
| - cm.append(mcolors.to_rgba(c)) |
56 |
| - if len(cm) >= len(values): |
57 |
| - break |
58 |
| - i += 1 |
59 |
| - return cm |
60 |
| - |
61 |
| - |
62 | 37 | def concentration_heatmap(
|
63 | 38 | simulation_result, species, z_slice: int = 0, title=None, ax=None, cmap=None
|
64 | 39 | ):
|
|
0 commit comments