RunTheGauntlet
RunTheGauntlet

Reputation: 302

List of colormaps added in proplot

In case of matplotlib it is possible to get the list of available colors (names) with:

import matplotlib.pyplot as plt
x = list(plt.colormaps())

Despite googling I was unable to find equivalent of it for Proplot module. https://proplot.readthedocs.io/en/latest/colormaps.html How to access those?

Upvotes: 0

Views: 135

Answers (1)

ouroboros1
ouroboros1

Reputation: 14414

Not sure if there is a function you can call, but you could just access the CMAPS_TABLE variable directly from pplt.demos.py. I.e.:

import proplot as pplt

colors = pplt.demos.CMAPS_TABLE

# result `head` of dict:
from itertools import islice
dict(islice(colors.items(), 0, 5))

{'Grayscale': ('Greys', 'Mono', 'MonoCycle'),
 'Matplotlib sequential': ('viridis', 'plasma', 'inferno', 'magma', 'cividis'),
 'Matplotlib cyclic': ('twilight',),
 'Seaborn sequential': ('Rocket', 'Flare', 'Mako', 'Crest'),
 'Seaborn diverging': ('IceFire', 'Vlag')}

Upvotes: 1

Related Questions