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 Donate

  • 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.

Donation

  • This package is created and maintained in my free time. If this package is usefull, you can show your gratitude :) Thanks!

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

colourmap-0.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

colourmap-0.1.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file colourmap-0.1.1.tar.gz.

File metadata

  • Download URL: colourmap-0.1.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0.post20200127 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.10

File hashes

Hashes for colourmap-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9a0c35ab62430a3825167ccbd654d5221dc54e723bd69c6b850b9b52e5bd0f6a
MD5 6c0a3c5b40c3096bcd790321148990e7
BLAKE2b-256 19c52afaffb7305e6e6095bca0fa93416cff00aa7cc2d3e2d1f25de800aa2bbe

See more details on using hashes here.

File details

Details for the file colourmap-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: colourmap-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0.post20200127 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.10

File hashes

Hashes for colourmap-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b86133ba6362fe42297e2b5667e2798b3fe4380488a95be4d4cd1791f7594d2
MD5 bd86b462cfeab029888f5832f754b0dc
BLAKE2b-256 239208ea8b1fd79b74569c2ab4bed81ec16392462286dac182fd57492c9376e0

See more details on using hashes here.

Supported by

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