Creates a custom color palette
Project description
custom_colors_palette
Python package to create a custom color palette using Matplotlib's colors name, Matplotlib's Colormap, Hex color code or RGB color code.
Version
0.2.1
Requirements
- Numpy
- Matplotlib
Usage
See the jupyter notebooks for the last version:
Old version:
Reference Guide
Click on the item to see the function and their description.
range
range(vmin, vmax, step)
Creates a range of numbers that include the extreme values.
Parameters
----------
vmin: int or float
First value of sequence of numbers.
vmax: int or float
Last value of sequence of numbers.
step: int or float
Step used to create sequence of numbers between vmin and vmax.
Returns
-------
Return a numpy.ndarray with range of number between vmin and vmax.
range
creates_palette(Palette_Attr, extend='neither', lower_color=None, upper_color=None, nan_color=None)
Creates a custom color palette from color list.
Parameters
----------
Palette_Attr : list
List that contains sublists with the characteristics of the
colors that will be used to create a custom color palette.
Each sublist must has three elements: [Colors, Limits, Stretch]
Colors : list or Matplotlib's Colormap
Defines the colors that will be used to create the
palette. Colors must be a Matplotlib's Colormap,
a list with Matplotlib's colors name,
a list with Hex color code or
a list with RGB color code.
Limits : list or numpy.ndarray
Defines the limits of each color of palette.
Stretch : list, optional
Optional list used to stretch the color palette
in order to obtain colors from a specific region.
Stretch must have 3 elements: [Values, Vini, Vfin]
Values : list or numpy.ndarray
Sequence of numbers that will be cut.
Vini : int or float
First value used to cut Values.
Vfin : int or float
Last value used to cut Values.
If Stretch is defined, the number of colors between
Vini and Vfin must be equal to Colors.
extend : str, default 'neither'
It is an optional parameter that is used to sets the extreme color of
palette. The valid options are 'neither', 'min', 'max', and
'both'.
lower_color : str, tuple, or None, default None
It defines lower color of palette.
upper_color : str, tuple, or None, default None
It defines upper color of palette.
nan_color : str, tuple, or None, default None
It defines color of nan values.
Returns
-------
Palette: object
Custom color palette
Ticks: list
Limits of each color in the palette.
Norm: class matplotlib.colors.BoundaryNorm
Norm of limits of each color.
Bounds: list
List with limits of each colors of Palette, including the extend values.
Installation
You can install custom_color_palette on Python 2 or 3 on Linux, Windows or other, using the following commands.
Using PIP:
pip install custom-color-palette
From github with clone.
clone https://github.com/joaohenry23/custom_color_palette.git
cd custom_color_palette
python setup.py install
Or also from github downloading custom_color_palette-master.zip and following the next commands.
unzip custom_color_palette-master.zip
cd custom_color_palette-master
python setup.py install
Check if package was installed
pip show custom-color-palette
Update to the latest version
pip install --upgrade custom-color-palette
Support
If you have any questions, do not hesitate to write to:
joaohenry23@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for custom_color_palette-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f654836d99ddfe62b3685457c11b1ea0fa603a667fc9e31b1e3b27323ee8eba2 |
|
MD5 | 06ce42fa650bd4754055994221d98e0b |
|
BLAKE2b-256 | 8bc955656b2b71378764579fc986e91e9096d14be391c717d895260c79b6a3eb |
Hashes for custom_color_palette-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3da67acc1d933fcf3a5e82fc5d2cfe957de00ce061023ce61575cd7232c1f06b |
|
MD5 | 17fb1d33d9f846ded49b83c556596a59 |
|
BLAKE2b-256 | bd41890381f350a300732d91bf53ecfd8715ed60ed59257a47e2298f8e3a053b |