def _background_gradient(s, cmap='PuBu', low=0, high=0): """Color background in a range according to the data.""" with _mpl(Styler.background_gradient) as (plt, colors): rng = s.max() - s.min() # extend lower / upper bounds, compresses color range norm = colors.Normalize(s.min() - (rng * low), s.max() + (rng * high)) # matplotlib modifies inplace?

Herding uo outlandsPlot a checkerboard table / heatmap via matplotlib. Parameters. ary: array-like, shape = [n, m] A 2D Nnumpy array. cell_colors: tuple or list (default: ('white', 'black')) Tuple or list containing the two colors of the checkerboard pattern. font_colors: tuple or list (default: ('black', 'white')) Font colors corresponding to the cell colors.

Most of the Matplotlib utilities lies under the pyplot submodule, and are usually imported under the plt alias import matplotlib.pyplot as plt import numpy as np.