diff --git a/bin/geoviewer.py b/bin/geoviewer.py index c77aca6f..a50b2b27 100755 --- a/bin/geoviewer.py +++ b/bin/geoviewer.py @@ -181,12 +181,16 @@ def main(test_args: Sequence[str] = None) -> None: vmax = None # color map + # Get the list of existing color maps, including reversed maps + mpl_cmap_list = list(plt.cm.datad.keys()) + mpl_cmap_list.extend([cmap + "_r" for cmap in mpl_cmap_list]) + if args.cmap == "default": cmap = plt.rcParams["image.cmap"] - elif args.cmap in plt.cm.datad.keys(): + elif args.cmap in mpl_cmap_list: cmap = args.cmap else: - raise ValueError("Wrong cmap, must be in: {}".format(",".join(str(elem) for elem in plt.cm.datad.keys()))) + raise ValueError("Wrong cmap, must be in: {}".format(",".join(str(elem) for elem in mpl_cmap_list))) # Figsize if args.figsize == "default": diff --git a/tests/test_geoviewer.py b/tests/test_geoviewer.py index 1763e00c..66cde9da 100644 --- a/tests/test_geoviewer.py +++ b/tests/test_geoviewer.py @@ -24,6 +24,7 @@ ( (), ("-cmap", "Reds"), + ("-cmap", "Reds_r"), ("-vmin", "-10", "-vmax", "10"), ("-vmin", "5%", "-vmax", "95%"), ("-band", "1"),