seaborn.axes_style

  1. seaborn.axes_style(style=None, rc=None)

Return a parameter dict for the aesthetic style of the plots.

This affects things like the color of the axes, whether a grid is enabled by default, and other aesthetic elements.

This function returns an object that can be used in a with statement to temporarily change the style parameters.

参数:style:dict, None, or one of {darkgrid, whitegrid, dark, white, ticks}

A dictionary of parameters or the name of a preconfigured set.

rc:dict, optional

Parameter mappings to override the values in the preset seaborn style dictionaries. This only updates parameters that are considered part of the style definition.

See also

set the matplotlib parameters for a seaborn themereturn a parameter dict to to scale plot elementsdefine the color palette for a plot

Examples

  1. >>> st = axes_style("whitegrid")
  1. >>> set_style("ticks", {"xtick.major.size": 8, "ytick.major.size": 8})
  1. >>> import matplotlib.pyplot as plt
  2. >>> with axes_style("white"):
  3. ... f, ax = plt.subplots()
  4. ... ax.plot(x, y)