Skip to main content

Farrow&Ball Matplotlib

pypi Badge

This is a python port for the matplotlib library of the R Package for ggplot2.

spec palette charts tonka palette charts

The style for the charts is provided in the styles folder

Installation

A python version >= 3 is required.

pip install farrow-and-ball

Usage

The usage is quite simple:

from farrow_and_ball import *
import numpy as np
import matplotlib.pyplot as plt

# Define a gray scale image
x = np.arange(0, np.pi, 0.1)
y = np.arange(0, 2 * np.pi, 0.1)
X, Y = np.meshgrid(x, y)
Z = np.cos(X) * np.sin(Y) * 10

# Get the color map
cmap = build_colormap(DivergentPalette.DAY, True)

# Draw image
plt.imshow(Z, origin="lower", cmap=cmap)
plt.show()

One can also directly get the color map definition as a list of strings with farrow_and_ball.get_palette(DivergentPalette.DAY) or an interpolated one with farrow_and_ball.get_interpolated_palette(DivergentPalette.DAY, num_classes).

Palettes

The palettes are organized in Enums:

class SpectralPalette(Enum):
    DEEPSPEC = "deepspec"
    SPEC = "spec"
    LIGHTSPEC = "lightspec"
    LIGHTERSPEC = "lighterspec"


class DivergentPalette(Enum):
    DAY = "day"
    DAYLONG = "daylong"
    ARMY = "army"
    MONO = "mono"


class BaseColorPalette(Enum):
    PINKS = "pinks"
    PINKS_VAR = "pinks2"
    REDS = "reds"
    YELLOWS = "yellows"
    GREENS = "greens"
    GREENS_VAR = "greens2"
    BLUES = "blues"
    BLUES_VAR = "blues2"


class MiscPalette(Enum):
    TONKA = "tonka"
    BELLSPOUT = "bellsprout"
    DOCKERS = "dockers"
    FRUITYPEBBLES = "fruitypebbles"

One can also directly enter the name as a string, e.g. build_colormap("day", True).

Color Maps

Continuous

Spectral Palette Divergent Palette Base Color Palette Misc Palette

Discrete

Spectral Palette Divergent Palette Base Color Palette Misc Palette

Release files for farrow-and-ball 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for farrow-and-ball 0.0.3
File Size Uploaded
farrow-and-ball-0.0.3.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for farrow-and-ball 0.0.3
File Interpreter ABI Platform
farrow_and_ball-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 12.7 kB

Release files / farrow-and-ball-0.0.3.tar.gz

Download URL farrow-and-ball-0.0.3.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dfbccc5e3b2e8e4953ed5a46fd24fe06d5789b9468185acb58a3ff63ef727fa6
BLAKE2b-256 checksum
How to use checksums
24c1788170b886c0b7b0849729112b26e91007cc8374bac3509f3db569dc2d59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.3

Release files / farrow_and_ball-0.0.3-py3-none-any.whl

Download URL farrow_and_ball-0.0.3-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f9f09d0278ee65a6438906a6c9a616322a5056b7dc2fdedca964e518d824141
BLAKE2b-256 checksum
How to use checksums
de6f1a9f1211d65dbe810de11e2930fdb2a5a83e3b14d1852a38d2cb0edb5097
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page