Skip to main content

Python package colourmap generates an N unique colors from the specified input colormap.

Project description

colourmap

Python PyPI Version License Downloads

  • Python package colourmap generates an N unique colors from the specified input colormap.

Contents

Installation

  • Install colourmap from PyPI (recommended). colourmap is compatible with Python 3.6+ and runs on Linux, MacOS X and Windows.
  • It is distributed under the MIT license.

Requirements

# This can be done manually but is also done automatically when pip installing colourmap.
pip install -r requirements

Quick Start

pip install colourmap
  • Alternatively, install colourmap from the GitHub source:
git clone https://github.com/erdogant/colourmap.git
cd colourmap
python setup.py install

Import colourmap package

import colourmap as colourmap

Example:

N=10
# Create N colors
getcolors=colourmap.generate(N)

# With different cmap
getcolors=colourmap.generate(N, cmap='Set2')

# Create color for label
y=[1,1,2,2,3,1,2,3]
label_colors, colordict=colourmap.fromlist(y)
# With different cmap
label_colors, colordict=colourmap.fromlist(y, cmap='Set2')
# With different method
label_colors, colordict=colourmap.fromlist(y, cmap='Set2', method='seaborn')

# String as input labels
y=['1','1','2','2','3','1','2','3']
label_colors, colordict=colourmap.fromlist(y)
# With different cmap
label_colors, colordict=colourmap.fromlist(y, cmap='Set2')
# With different method
label_colors, colordict=colourmap.fromlist(y, cmap='Set2', method='seaborn')

Citation

Please cite colourmap in your publications if this is useful for your research. Here is an example BibTeX entry:

@misc{erdogant2019colourmap,
  title={colourmap},
  author={Erdogan Taskesen},
  year={2019},
  howpublished={\url{https://github.com/erdogant/colourmap}},
}

Maintainers

Contribute

  • Contributions are welcome.

Licence

See LICENSE for details.

Project details


Release history Release notifications

Download files

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

Files for colourmap, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size colourmap-0.1.0-py3-none-any.whl (4.6 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size colourmap-0.1.0.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page