fh.colors

Functions

fh.colors.cbrewer

fh.colors.cbrewer(ctype, cname, ncol, interp_method)

CBREWER - This function produces a colorbrewer table (rgb data) for a given type, name and number of colors of the colorbrewer tables. For more information on ‘colorbrewer’, please visit http://colorbrewer2.org/

The tables were generated from an MS-Excel file provided on the website http://www.personal.psu.edu/cab38/ColorBrewer/ColorBrewer_updates.html

[colormap]=cbrewer(ctype, cname, ncol, interp_method)

INPUT:
  • ctype: type of color table ‘seq’ (sequential), ‘div’ (diverging), ‘qual’ (qualitative)

  • cname: name of colortable. It changes depending on ctype.

  • ncol: number of color in the table. It changes according to ctype and

    cname

  • interp_method: interpolation method (see interp1.m). Default is “cubic” )

A note on the number of colors: Based on the original data, there is only a certain number of colors available for each type and name of colortable. When ‘ncol’ is larger then the maximum number of colors originally given, an interpolation routine is called (interp1) to produce the “extended” colormaps.

Example: To produce a colortable CT of ncol X 3 entries (RGB) of
sequential type and named ‘Blues’ with 8 colors:

CT=cbrewer(‘seq’, ‘Blues’, 8);

To use this colortable as colormap, simply call:

colormap(CT)

To see the various colormaps available according to their types and names, simply call: cbrewer()

This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/).

Author: Charles Robert email: tannoudji@hotmail.com Date: 06.12.2011 —————————— 18.09.2015 Minor fixes, fixed a bug where the ‘spectral’ color table did not appear in the preview

fh.colors.colorspecer

fh.colors.colorspecer(N, Type, Set, opts)

fh.colors.interp_colormap

fh.colors.interp_colormap(colors, vars, opts)

fh.colors.interpolate_cbrewer

fh.colors.interpolate_cbrewer(cbrew_init, interp_method, ncolors)

INTERPOLATE_CBREWER - interpolate a colorbrewer map to ncolors levels

INPUT:
  • cbrew_init: the initial colormap with format N*3

  • interp_method: interpolation method, which can be the following:

    ‘nearest’ - nearest neighbor interpolation ‘linear’ - bilinear interpolation ‘spline’ - spline interpolation ‘cubic’ - bicubic interpolation as long as the data is

    uniformly spaced, otherwise the same as ‘spline’

  • ncolors=desired number of colors

Author: Charles Robert email: tannoudji@hotmail.com Date: 14.10.2011

fh.colors.redblue

fh.colors.redblue(n, range, opts)

REDBLUE Shades of red and blue color map REDBLUE(n,range), returns c whichis a nx3 colour map starting at blue, moving to white, then going to red. The white is centred according to the range parameter which is a 1x3 array, where range(1) is the minimal value of your function, range(2) is the val which should be white, and range(3) is the max val of you function. On either side of white the rate of change of blue or red is constant, hence if range(2) is not in the middle only one side will reach either fully red or blue.

Copyright Fintan Healy, 10/03/2022, fintan.healy@bristol.ac.uk

fh.colors.uob

fh.colors.uob(N, type)