|
1 | 1 | from typing import Tuple, Optional, Union, List |
2 | 2 |
|
3 | 3 | import numpy |
4 | | -from matplotlib import colors, cm |
| 4 | +import matplotlib |
5 | 5 | from matplotlib.axes import Axes |
6 | 6 | from matplotlib.collections import LineCollection |
7 | | -from matplotlib.colors import ListedColormap, Normalize |
| 7 | +from matplotlib.colors import ListedColormap |
8 | 8 |
|
9 | 9 | # Colors Sander Tans likes in his figures - these are all bright colors |
10 | 10 | # Source: flatuicolors.com - US palette |
11 | 11 | from numpy import ndarray |
12 | 12 |
|
13 | 13 | from organoid_tracker.core.typing import MPLColor |
14 | 14 |
|
15 | | -SANDER_APPROVED_COLORS = colors.to_rgba_array(["#55efc4", "#fdcb6e", "#636e72", "#74b9ff", "#e84393", |
| 15 | +SANDER_APPROVED_COLORS = matplotlib.colors.to_rgba_array(["#55efc4", "#fdcb6e", "#636e72", "#74b9ff", "#e84393", |
16 | 16 | "#ff7675", "#fd79a8", "#fab1a0", "#e84393"]) |
17 | 17 |
|
18 | 18 | # A bit darker colors |
|
25 | 25 | HISTOGRAM_BLUE = (0, 0, 1, 0.5) |
26 | 26 |
|
27 | 27 | def _create_qualitative_colormap() -> ListedColormap: |
28 | | - color_list = cm.get_cmap('jet', 256)(numpy.linspace(0, 1, 256)) |
| 28 | + color_list = matplotlib.colormaps.get_cmap('jet')(numpy.linspace(0, 1, 256)) |
29 | 29 | numpy.random.shuffle(color_list) |
30 | 30 | color_list[0] = numpy.array([0, 0, 0, 1]) # First color is black |
31 | 31 | return ListedColormap(color_list) |
|
0 commit comments