Skip to main content

NMFS color palettes handling library

Project description

nmfspalettepy

logo

nmfspalettepy is a Python library designed to facilitate the use of National Marine Fisheries Service (NMFS) color palettes for data visualization. It provides easy access to a series of NMFS color schemes.

Source:

Features

  • Provides a set of predefined color palettes using the NMFS color palettes.
  • Functions to display and utilize these palettes in visualizations.
  • Easy integration with matplotlib for creating custom color maps.

Installation

Install (https://pypi.org/project/nmfspalettepy/)

To install nmfspalettepy, you can use pip. Run the following command:

pip install nmfspalettepy

Install From Source

git clone -b nmfspalettepy https://github.com/MichaelAkridge-NOAA/NOAA-NMFS-Brand-Resources.git
cd NOAA-NMFS-Brand-Resources
python setup.py install

To Use

Listing Available Color Palettes

To see a list of all available color palettes you can use with nmfspalettepy, simply call the list_nmfs_palettes function:

import nmfspalettepy
print(nmfspalettepy.list_nmfs_palettes())

Usage Examples

Display a Color Gradient

To display a color gradient using one of the available NMFS color palettes, you can use the display_color_gradient function. Here's an example using the "oceans" palette:

from nmfspalettepy import display_color_gradient, get_palette_colors

# Display the 'oceans' palette gradient
display_color_gradient(get_palette_colors("oceans"))

Creating a Custom Color Map

import matplotlib.pyplot as plt
from nmfspalettepy import create_nmfs_colormap

# Create a custom colormap
cmap = create_nmfs_colormap("coral")

# Use the colormap in a plot
plt.imshow([[1,2],[2,3]], cmap=cmap)
plt.colorbar()
plt.show()

Getting Hex Codes for a Palette

from nmfspalettepy import get_palette_colors

# Get hex codes for the 'waves' palette
colors_hex = get_palette_colors("waves")
print("Hex codes for 'waves':", colors_hex)


Disclaimer

This repository is a scientific product and is not official communication of the National Oceanic and Atmospheric Administration, or the United States Department of Commerce. All NOAA GitHub project content is provided on an ‘as is’ basis and the user assumes responsibility for its use. Any claims against the Department of Commerce or Department of Commerce bureaus stemming from the use of this GitHub project will be governed by all applicable Federal law. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by the Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC bureau, shall not be used in any manner to imply endorsement of any commercial product or activity by DOC or the United States Government.

License

See the LICENSE.md for details

Credits

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

nmfspalettepy-0.1.6.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

nmfspalettepy-0.1.6-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file nmfspalettepy-0.1.6.tar.gz.

File metadata

  • Download URL: nmfspalettepy-0.1.6.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for nmfspalettepy-0.1.6.tar.gz
Algorithm Hash digest
SHA256 ec80ddd7b46cedd083c8dba07586c2f27cffc416322387cf93144dd47520e7bc
MD5 fbb2edb5511f1d1034caa614d8736c80
BLAKE2b-256 1ece1ff944ba73e1ecb9d4b069a4e0dbec437c1bc6bfb37eb99b2252e4446b78

See more details on using hashes here.

File details

Details for the file nmfspalettepy-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: nmfspalettepy-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for nmfspalettepy-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9a78fe23ab9679db50f556aef3f7a042c16f297952e155e58ebea773aa9547f4
MD5 3924410c031a0fc9ffc47811e91e71ae
BLAKE2b-256 0bb172fd0a945a563ebf2e414e5ae5bee3abb773b8e37d1239cf9d465798c50f

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