Map Styling Functions¶
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.
-
quantiles
¶ Quantiles classification for quantitative data
Type: str
-
jenks
¶ Jenks classification for quantitative data
Type: str
-
headtails
¶ Head/Tails classification for quantitative data
Type: str
-
equal
¶ Equal Interval classification for quantitative data
Type: str
-
category
¶ Category classification for qualitative data
Type: str
-
mapping
¶ The TurboCarto mappings
Type: dict
-
-
cartoframes.styling.
get_scheme_cartocss
(column, scheme_info) Get TurboCARTO CartoCSS based on input parameters
-
cartoframes.styling.
custom
(colors, bins=None, bin_method='quantiles') Create a custom scheme.
Parameters: - 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.
scheme
(name, bins, bin_method='quantiles') Return a custom scheme based on CARTOColors.
Parameters: - 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 toquantiles
. If bins is an interable, then that is the bin method that will be used and this will be ignored.
Warning
Input types are particularly sensitive in this function, and little feedback is given for errors.
name
andbin_method
arguments are case-sensitive.
-
cartoframes.styling.
burg
(bins, bin_method='quantiles') CARTOColors Burg quantitative scheme
-
cartoframes.styling.
burgYl
(bins, bin_method='quantiles') CARTOColors BurgYl quantitative scheme
-
cartoframes.styling.
redOr
(bins, bin_method='quantiles') CARTOColors RedOr quantitative scheme
-
cartoframes.styling.
orYel
(bins, bin_method='quantiles') CARTOColors OrYel quantitative 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.
mint
(bins, bin_method='quantiles') CARTOColors Mint quantitative scheme
-
cartoframes.styling.
bluGrn
(bins, bin_method='quantiles') CARTOColors BluGrn quantitative scheme
-
cartoframes.styling.
darkMint
(bins, bin_method='quantiles') CARTOColors DarkMint quantitative scheme
-
cartoframes.styling.
emrld
(bins, bin_method='quantiles') CARTOColors Emrld quantitative scheme
-
cartoframes.styling.
bluYl
(bins, bin_method='quantiles') CARTOColors BluYl 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.
purp
(bins, bin_method='quantiles') CARTOColors Purp quantitative scheme
-
cartoframes.styling.
purpOr
(bins, bin_method='quantiles') CARTOColors PurpOr quantitative scheme
-
cartoframes.styling.
sunset
(bins, bin_method='quantiles') CARTOColors Sunset quantitative scheme
-
cartoframes.styling.
magenta
(bins, bin_method='quantiles') CARTOColors Magenta quantitative scheme
-
cartoframes.styling.
sunsetDark
(bins, bin_method='quantiles') CARTOColors SunsetDark quantitative scheme
-
cartoframes.styling.
brwnYl
(bins, bin_method='quantiles') CARTOColors BrwnYl quantitative scheme
-
cartoframes.styling.
armyRose
(bins, bin_method='quantiles') CARTOColors ArmyRose divergent quantitative scheme
-
cartoframes.styling.
fall
(bins, bin_method='quantiles') CARTOColors Fall divergent quantitative scheme
-
cartoframes.styling.
geyser
(bins, bin_method='quantiles') CARTOColors Geyser divergent quantitative scheme
-
cartoframes.styling.
temps
(bins, bin_method='quantiles') CARTOColors Temps divergent quantitative scheme
-
cartoframes.styling.
tealRose
(bins, bin_method='quantiles') CARTOColors TealRose divergent quantitative scheme
-
cartoframes.styling.
tropic
(bins, bin_method='quantiles') CARTOColors Tropic divergent quantitative scheme
-
cartoframes.styling.
earth
(bins, bin_method='quantiles') CARTOColors Earth divergent quantitative scheme
-
cartoframes.styling.
antique
(bins, bin_method='category') CARTOColors Antique qualitative scheme
-
cartoframes.styling.
bold
(bins, bin_method='category') CARTOColors Bold qualitative scheme
-
cartoframes.styling.
pastel
(bins, bin_method='category') CARTOColors Pastel qualitative scheme
-
cartoframes.styling.
prism
(bins, bin_method='category') CARTOColors Prism qualitative scheme
-
cartoframes.styling.
safe
(bins, bin_method='category') CARTOColors Safe qualitative scheme
-
cartoframes.styling.
vivid
(bins, bin_method='category') CARTOColors Vivid qualitative scheme