skip to navigation
skip to content

Not Logged In

brewer2mpl 1.1

Connect color maps to Python and matplotlib

Latest Version: 1.4.1

brewer2mpl is a pure Python package for accessing color maps from Python. With brewer2mpl you can get the raw RGB colors of all 165 color maps. The color map data ships with brewer2mpl so no internet connection is required.

For more information and to view some of the color maps see the wiki at

Color Maps has 3 map types: sequential, diverging, and qualitative. Each color map has between 3 and 12 defined colors.


Listing Color Maps

List all of the available color maps:


List maps by type:


Filter by number of colors defined:

brewer2mpl.print_maps('qualitative', 6)

Get a Color Map

Color maps are accessed by name, type, and number:

bmap = brewer2mpl.get_map('Paired', 'Qualitative', 5)

If you want a color map reversed from how it is given by set the reverse keyword to True:

bmap = brewer2mpl.get_map('Paired', 'Qualitative', 5, reverse=True)

BrewerMap Objects

Color maps are represented by BrewerMap objects. They have a few useful attributes:

# url.
# Copy this into your browser to see the map at

# name

# number of defined colors

# colors as a list of RGB 0-255 triplets

# colors as a list of hex strings

# colors as a list of RGB 0-1 triplets (as used by matplotlib)

# matplotlib color map

The matplotlib color maps are created using matplotlib.colors.LinearSegmentedColormap.from_list. If you want to pass options to that method use the BrewerMap.get_mpl_colormap method:

cmap = bmap.get_mpl_colormap(N=1000, gamma=2.0)
File Type Py Version Uploaded on Size
brewer2mpl-1.1.tar.gz (md5) Source 2012-07-25 14KB (md5) Source 2012-07-25 16KB
  • Downloads (All Versions):
  • 312 downloads in the last day
  • 1907 downloads in the last week
  • 8750 downloads in the last month