cartoframes.styling module

Styling module that exposes CARTOColors schemes. Read more about CARTOColors in its GitHub repository.

class cartoframes.styling.BinMethod

Data classification methods used for the styling of data on maps.


str – Quantiles classification for quantitative data


str – Jenks classification for quantitative data


str – Head/Tails classification for quantitative data


str – Equal Interval classification for quantitative data


str – Category classification for qualitative data


dict – The TurboCarto mappings

category = 'category'
equal = 'equal'
headtails = 'headtails'
jenks = 'jenks'
mapping = {'category': '=', 'quantiles': '>', 'jenks': '>', 'equal': '>', 'headtails': '<'}
quantiles = 'quantiles'
cartoframes.styling.antique(bins, bin_method='category')

CARTOColors Antique qualitative scheme

cartoframes.styling.armyRose(bins, bin_method='quantiles')

CARTOColors ArmyRose divergent quantitative scheme

cartoframes.styling.bluGrn(bins, bin_method='quantiles')

CARTOColors BluGrn quantitative scheme

cartoframes.styling.bluYl(bins, bin_method='quantiles')

CARTOColors BluYl quantitative scheme

cartoframes.styling.bold(bins, bin_method='category')

CARTOColors Bold qualitative scheme

cartoframes.styling.brwnYl(bins, bin_method='quantiles')

CARTOColors BrwnYl quantitative scheme

cartoframes.styling.burg(bins, bin_method='quantiles')

CARTOColors Burg quantitative scheme

cartoframes.styling.burgYl(bins, bin_method='quantiles')

CARTOColors BurgYl quantitative scheme

cartoframes.styling.custom(colors, bins=None, bin_method='quantiles')

Create a custom scheme.

  • colors (list of str) – List of hex values for styling data
  • bins (int, optional) – Number of bins to style by. If not given, the number of colors will be used.
  • bin_method (str, optional) – Classification method. One of the values in BinMethod. Defaults to quantiles, which only works with quantitative data.
cartoframes.styling.darkMint(bins, bin_method='quantiles')

CARTOColors DarkMint quantitative scheme, bin_method='quantiles')

CARTOColors Earth divergent quantitative scheme

cartoframes.styling.emrld(bins, bin_method='quantiles')

CARTOColors Emrld quantitative scheme

cartoframes.styling.fall(bins, bin_method='quantiles')

CARTOColors Fall divergent quantitative scheme

cartoframes.styling.get_scheme_cartocss(column, scheme_info)

Get TurboCARTO CartoCSS based on input parameters

cartoframes.styling.geyser(bins, bin_method='quantiles')

CARTOColors Geyser divergent quantitative scheme

cartoframes.styling.magenta(bins, bin_method='quantiles')

CARTOColors Magenta quantitative scheme, bin_method='quantiles')

CARTOColors Mint quantitative scheme

cartoframes.styling.orYel(bins, bin_method='quantiles')

CARTOColors OrYel quantitative scheme

cartoframes.styling.pastel(bins, bin_method='category')

CARTOColors Pastel qualitative scheme

cartoframes.styling.peach(bins, bin_method='quantiles')

CARTOColors Peach quantitative scheme

cartoframes.styling.pinkYl(bins, bin_method='quantiles')

CARTOColors PinkYl quantitative scheme

cartoframes.styling.prism(bins, bin_method='category')

CARTOColors Prism qualitative scheme

cartoframes.styling.purp(bins, bin_method='quantiles')

CARTOColors Purp quantitative scheme

cartoframes.styling.purpOr(bins, bin_method='quantiles')

CARTOColors PurpOr quantitative scheme

cartoframes.styling.redOr(bins, bin_method='quantiles')

CARTOColors RedOr quantitative scheme, bin_method='category')

CARTOColors Safe qualitative scheme

cartoframes.styling.scheme(name, bins, bin_method='quantiles')

Return a custom scheme based on CARTOColors.

  • name (str) – Name of a CARTOColor.
  • bins (int or iterable) – If an int, the number of bins for classifying data. CARTOColors have 7 bins max for quantitative data, and 11 max for qualitative data. If bins is a list, it is the upper range for classifying data. E.g., bins can be of the form (10, 20, 30, 40, 50).
  • bin_method (str, optional) – One of methods in BinMethod. Defaults to quantiles. If bins is an interable, then that is the bin method that will be used and this will be ignored.


Input types are particularly sensitive in this function, and little feedback is given for errors. name and bin_method arguments are case-sensitive.

cartoframes.styling.sunset(bins, bin_method='quantiles')

CARTOColors Sunset quantitative scheme

cartoframes.styling.sunsetDark(bins, bin_method='quantiles')

CARTOColors SunsetDark quantitative scheme

cartoframes.styling.teal(bins, bin_method='quantiles')

CARTOColors Teal quantitative scheme

cartoframes.styling.tealGrn(bins, bin_method='quantiles')

CARTOColors TealGrn quantitative scheme

cartoframes.styling.tealRose(bins, bin_method='quantiles')

CARTOColors TealRose divergent quantitative scheme

cartoframes.styling.temps(bins, bin_method='quantiles')

CARTOColors Temps divergent quantitative scheme

cartoframes.styling.tropic(bins, bin_method='quantiles')

CARTOColors Tropic divergent quantitative scheme

cartoframes.styling.vivid(bins, bin_method='category')

CARTOColors Vivid qualitative scheme