ormats.style.Styler.set_properties.html)
    * [ pandas.io.formats.style.Styler.set_uuid ](pandas.io.formats.style.Styler.set_uuid.html)
    * [ pandas.io.formats.style.Styler.clear ](pandas.io.formats.style.Styler.clear.html)
    * [ pandas.io.formats.style.Styler.pipe ](pandas.io.formats.style.Styler.pipe.html)
    * [ pandas.io.formats.style.Styler.highlight_null ](pandas.io.formats.style.Styler.highlight_null.html)
    * [ pandas.io.formats.style.Styler.highlight_max ](pandas.io.formats.style.Styler.highlight_max.html)
    * [ pandas.io.formats.style.Styler.highlight_min ](pandas.io.formats.style.Styler.highlight_min.html)
    * [ pandas.io.formats.style.Styler.highlight_between ](pandas.io.formats.style.Styler.highlight_between.html)
    * [ pandas.io.formats.style.Styler.highlight_quantile ](pandas.io.formats.style.Styler.highlight_quantile.html)
    * pandas.io.formats.style.Styler.background_gradient 
    * [ pandas.io.formats.style.Styler.text_gradient ](pandas.io.formats.style.Styler.text_gradient.html)
    * [ pandas.io.formats.style.Styler.bar ](pandas.io.formats.style.Styler.bar.html)
    * [ pandas.io.formats.style.Styler.to_html ](pandas.io.formats.style.Styler.to_html.html)
    * [ pandas.io.formats.style.Styler.to_latex ](pandas.io.formats.style.Styler.to_latex.html)
    * [ pandas.io.formats.style.Styler.to_excel ](pandas.io.formats.style.Styler.to_excel.html)
    * [ pandas.io.formats.style.Styler.to_string ](pandas.io.formats.style.Styler.to_string.html)
    * [ pandas.io.formats.style.Styler.export ](pandas.io.formats.style.Styler.export.html)
    * [ pandas.io.formats.style.Styler.use ](pandas.io.formats.style.Styler.use.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ Style ](../style.html)
  * pandas.io.fo... 

#  pandas.io.formats.style.Styler.background_gradient  #

Styler.  background_gradient  (  _ cmap  =  'PuBu'  _ , _ low  =  0  _ , _
high  =  0  _ , _ axis  =  0  _ , _ subset  =  None  _ , _
text_color_threshold  =  0.408  _ , _ vmin  =  None  _ , _ vmax  =  None  _ ,
_ gmap  =  None  _ )  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/io/formats/style.py#L2829-L2979) #

    

Color the background in a gradient style.

The background color is determined according to the data in each column, row
or frame, or by a given gradient map. Requires matplotlib.

Parameters  :

    

**cmap** str or colormap

    

Matplotlib colormap.

**low** float

    

Compress the color range at the low end. This is a multiple of the data range
to extend below the minimum; good values usually in [0, 1], defaults to 0.

**high** float

    

Compress the color range at the high end. This is a multiple of the data range
to extend above the maximum; good values usually in [0, 1], defaults to 0.

**axis** {0, 1, âindexâ, âcolumnsâ, None}, default 0

    

Apply to each column ( ` axis=0  ` or ` 'index'  ` ), to each row ( ` axis=1
` or ` 'columns'  ` ), or to the entire DataFrame at once with ` axis=None  `
.

**subset** label, array-like, IndexSlice, optional

    

A valid 2d input to  DataFrame.loc[<subset>]  , or, in the case of a 1d input
or single key, to  DataFrame.loc[:, <subset>]  where the columns are
prioritised, to limit ` data  ` to _before_ applying the function.

**text_color_threshold** float or int

    

Luminance threshold for determining text color in [0, 1]. Facilitates text

visibility across varying background colors. All text is dark if 0, and

light if 1, defaults to 0.408.

**vmin** float, optional

    

Minimum data value that corresponds to colormap minimum value. If not
specified the minimum value of the data (or gmap) will be used.

**vmax** float, optional

    

Maximum data value that corresponds to colormap maximum value. If not