--- title: pokepalette keywords: fastai sidebar: home_sidebar summary: "A simple pokemon color chooser" description: "A simple pokemon color chooser" nb_path: "nbs/index.ipynb" ---
This repo is based on CDWimmer/PokePalette
pip install pokepalette
import numpy as np
import matplotlib.pyplot as plt
import pokepalette
There is a handy SimpleNamespace
with all the pokemons and their colours available:
pokepalette.PokemonColours.pikachu
pikachu_cmap = pokepalette.get_colormap('pikachu')
You can plot passing the pikachu
colors directly
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
sizes = [15, 30, 45, 10]
explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs')
fig1, ax1 = plt.subplots()
ax1.pie(sizes, colors=pokepalette.PokemonColours.pikachu, explode=explode, labels=labels, autopct='%1.1f%%',
shadow=True, startangle=90)
ax1.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle.
plt.show()
or passing the corresponding matplotlib's colormap
plt.rcParams["figure.figsize"] = [7.50, 3.50]
plt.rcParams["figure.autolayout"] = True
N = 50
x = np.random.randn(N)
y = np.random.randn(N)
plt.scatter(x, y, c=x, cmap=pikachu_cmap)
plt.show()