Using style sheets
We have learned to set the style details step by step so far. The matplotlib.style
module provides a handy way to apply a predefined global style to the whole figure. There are a number of built-in style sheets coming along the matplotlib
package. You can call matplotlib.style.available
to check them out:
The function returns a list of built-in style sheets, including classic
, seaborn
, and ggplot
. Classic refers to the Matplotlib style before version 2.0. Seaborn is a popular package built on top of Matplotlib that offers some special plotting APIs and themes for generating aesthetically attractive statistical figures. In Matplotlib 2.0, we can easily work on the styling natively for simple plot types, without importing an extra module. Multiple style sheets for different purposes are available. The ggplot
style emulates ggplot_
, a popular plotting package in R that features vibrant colors on a gray data area with white lines.
Applying a style sheet
Using a style is as simple...