Skip to main content

Style plots with Pokemon colors

Project description

Palletetown is a python library that makes it easy to style matplotlib plots using a color palettes based on pokemon.

You can use palletetown to:

  • set global matplotlib settings based on a pokemon,
  • set a colormap for a pokemon,
  • set a color cycler for a pokemon,
  • draw a pokemon sprite,
  • get RGB color values from the sprite.

Check out the examples.ipynb jupyter notebook for examples.

Sample image

The pokeplot module handles high-level user interactions. Check out the jupyter notebook on our homepage for examples, or try these pokeplot features with your own plots.

import matplotlib.pyplot as plt
import numpy as np
import palletetown.pokeplot as pkp

# Get a colormap with colors set based on the pokemon sprite
cmap = pkp.get_cmap('pikachu')

# Use it with whatever plot you are working on.
data = np.random.random((10,10))
plt.imshow(data, cmap=cmap)

# Draw a pikachu sprite in the top right corner.
pkp.draw_sprite()

plt.show()

# The default colormap can be set.
pkp.set_rc('pikachu')

Pokemon and Pokedex objects can be manipulated directly for advanced use cases. A Pokemon object contains color data related to that pokemon. Pokedex objects are dictionary-like containers for Pokemon objects.

pikachu = pkp.get_pokemon('pikachu')
# matplotlib linear segmented colormap
cmap = pikachu.cmap
# color cycler
cycler = pikachu.cycler
# image of the pokemon as an ndarray
sprite = pikachu.sprite
# list of rgb colors as 8 bit integers
colors_int = pikachu.rgb_int
# list of rgb colors as floats normalized from 0. to 1.
colors_float = pikachu.rgb_float
# list of rgb colors as hex strings
colors_hex = pikachu.rgb_hex

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

palettetown-1.0.1.tar.gz (448.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

palettetown-1.0.1-py3-none-any.whl (703.4 kB view details)

Uploaded Python 3

File details

Details for the file palettetown-1.0.1.tar.gz.

File metadata

  • Download URL: palettetown-1.0.1.tar.gz
  • Upload date:
  • Size: 448.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.0

File hashes

Hashes for palettetown-1.0.1.tar.gz
Algorithm Hash digest
SHA256 51b2d2084c8ce434e6df8162cdc98adb0a7e53b73c31615092c29d5f3d9e3892
MD5 0091d554f44679364f9860fd8e0bccdf
BLAKE2b-256 d6a56c0cc83fdb99ec26e70d53ec3b3cc1e60682fd74482a5b2a2c6ebde476d5

See more details on using hashes here.

File details

Details for the file palettetown-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: palettetown-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 703.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.0

File hashes

Hashes for palettetown-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a77c145a8650b9a7ac44c5c195fecff7c01190930bf75273a93684c8a7e2adc
MD5 4abb4e8b888e77f5a3f483673b0c7384
BLAKE2b-256 851d301802b8825fd32896d40f151cc7a3d3e6793ba8296a54e1d54798d9a565

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page