diff --git a/openpnm/visualization/_plottools.py b/openpnm/visualization/_plottools.py index 3e3e9228a3..8cc91bc6f4 100644 --- a/openpnm/visualization/_plottools.py +++ b/openpnm/visualization/_plottools.py @@ -159,6 +159,7 @@ class of matplotlib, so check their documentation for additional cmap = plt.colormaps[cmap] # Override colors with color_by if given if color_by is not None: + color_by = np.array(color_by, dtype=np.float16) if len(color_by) != len(Ts): color_by = color_by[Ts] if not np.all(np.isfinite(color_by)): @@ -342,6 +343,7 @@ def plot_coordinates(network, if isinstance(cmap, str): cmap = plt.colormaps[cmap] if color_by is not None: + color_by = np.array(color_by, dtype=np.float16) if len(color_by) != len(Ps): color_by = color_by[Ps] if not np.all(np.isfinite(color_by)):