Styler.background_gradient(self, cmap='PuBu', low=0, high=0, axis=0, subset=None, text_color_threshold=0.408)
[source]
Color the background in a gradient according to the data in each column (optionally row).
Requires matplotlib.
Parameters: |
|
---|---|
Returns: |
|
Raises: |
|
Set text_color_threshold
or tune low
and high
to keep the text legible by not using the entire range of the color map. The range of the data is extended by low * (x.max() - x.min())
and high *
(x.max() - x.min())
before normalizing.
© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.io.formats.style.Styler.background_gradient.html