Skip to content

ahuang11/tastymap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

59 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

TastyMap

๐ŸŽจ Color palettes for your palate ๐Ÿ˜‹

Make, customize, and/or use colormaps, any way you like.

tastykitchen

๐Ÿ“– Quick start

Start cooking from pre-made colormaps...

from tastymap import cook_tmap

tmap = cook_tmap("viridis", num_colors=12, reverse=True)
tmap

viridis_12

Or start from scratch!

from tastymap import cook_tmap

tmap = cook_tmap(
    ["red", "green", "blue"],
    num_colors=256,
    reverse=True,
    name="rgb",
)
tmap

rgb_256

Then pair it with your plots effortlessly:

import numpy as np
from matplotlib import pyplot as plt
from tastymap import cook_tmap, pair_tbar

fig, ax = plt.subplots()
img = ax.imshow(np.random.random((10, 10)))
tmap = cook_tmap(["red", "green", "blue"], num_colors=256)
pair_tbar(
    img,
    tmap,
    bounds=[0, 0.01, 0.5, 1],
    labels=["zero", "tiny", "half", "one"],
    uniform_spacing=True,
)

example

Or if you need suggestions, get help from AI by providing a description of what you're imagining:

from tastymap import ai

tmap = ai.suggest_tmap("Pikachu")
tmap

image

Try to craft your visual delight interactively with the TastyKitchen UI, hosted here.

tastymap ui

Check out the docs for more recipes!

๐Ÿ“ฆ Installation

To get started on your culinary color journey, install tastymap with:

pip install tastymap

To get access to TastyKitchen UI, install tastymap with:

pip install tastymap[ui]

build codecov PyPI version

Documentation: https://ahuang11.github.io/tastymap/

Source Code: https://github.com/ahuang11/tastymap