Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahuang11/tastymap
🎨 colormaps cooked for your palate
https://github.com/ahuang11/tastymap
cmap colorbar colormaps customize data-visualization matplotlib palette python
Last synced: about 2 months ago
JSON representation
🎨 colormaps cooked for your palate
- Host: GitHub
- URL: https://github.com/ahuang11/tastymap
- Owner: ahuang11
- License: mit
- Created: 2023-09-25T03:46:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-18T23:13:01.000Z (10 months ago)
- Last Synced: 2024-10-13T23:06:01.186Z (2 months ago)
- Topics: cmap, colorbar, colormaps, customize, data-visualization, matplotlib, palette, python
- Language: Python
- Homepage: https://ahuang11.github.io/tastymap/
- Size: 85.9 KB
- Stars: 28
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# TastyMap
## 🎨 Color palettes for your palate 😋
Make, customize, and/or use colormaps, any way you like.
![tastykitchen](https://github.com/ahuang11/tastymap/assets/15331990/ce015064-2ffb-4da2-bb8e-4818fdd751ab)
## 📖 Quick start
Try to craft your visual delight *interactively* with the TastyKitchen UI, hosted [here](https://huggingface.co/spaces/ahuang11/tastykitchen).
```bash
tastymap ui
```Or, start cooking from pre-made colormaps...
```python
from tastymap import cook_tmaptmap = cook_tmap("viridis", num_colors=12, reverse=True)
tmap
```![viridis_12](https://github.com/ahuang11/tastymap/assets/15331990/ee9b429b-26d6-4eef-8128-a93f47a920ab)
Or start from scratch!
```python
from tastymap import cook_tmaptmap = cook_tmap(
["red", "green", "blue"],
num_colors=256,
reverse=True,
name="rgb",
)
tmap
```![rgb_256](https://github.com/ahuang11/tastymap/assets/15331990/b0964acc-56d1-4add-b9d4-fdc925756098)
Then pair it with your plots effortlessly:
```python
import numpy as np
from matplotlib import pyplot as plt
from tastymap import cook_tmap, pair_tbarfig, 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](https://github.com/ahuang11/tastymap/assets/15331990/04ab9ea7-d836-44b8-843d-2cb65eddfe63)
Or if you need suggestions, get help from AI by providing a description of what you're imagining:
```python
from tastymap import aitmap = ai.suggest_tmap("Pikachu")
tmap
```![image](https://github.com/ahuang11/tastymap/assets/15331990/5a6f2bd4-4c4f-449c-9f2a-3352c956400a)
Check out the [docs](https://ahuang11.github.io/tastymap) for more recipes!
## 📦 Installation
To get started on your culinary color journey, install `tastymap` with:
```bash
pip install tastymap
```To get access to TastyKitchen UI, install `tastymap` with:
```bash
pip install tastymap[ui]
```---
[![build](https://github.com/ahuang11/tastymap/workflows/Build/badge.svg)](https://github.com/ahuang11/tastymap/actions)
[![codecov](https://codecov.io/gh/ahuang11/tastymap/branch/master/graph/badge.svg)](https://codecov.io/gh/ahuang11/tastymap)
[![PyPI version](https://badge.fury.io/py/tastymap.svg)](https://badge.fury.io/py/tastymap)**Documentation**: https://ahuang11.github.io/tastymap/
**Source Code**: https://github.com/ahuang11/tastymap