MATPLOTLIB STYLES
Listing 5.1 displays the content of mpl_styles.py that illustrates how to plot a pie chart in Matplotlib.
LISTING 5.1: mpl_styles.py
import matplotlib.pyplot as plt
print("plt.style.available:")
styles = plt.style.available
for style in styles:
print("style:",style)
Listing 5.1 contains an import statement, followed by the variable styles, which is initialized with the set of available styles in Matplotlib. The final portion of Listing 5.1 contains a loop that iterates through the values in the styles variable. Launch the code in Listing 5.1, and you will see the following output:
plt.style.available: style: Solarize_Light2 style: _classic_test_patch style: bmh style: classic style: dark_background style: fast style: fivethirtyeight style: ggplot style: grayscale style: seaborn style: seaborn-bright style: seaborn-colorblind style: seaborn-dark style: seaborn-dark-palette style: seaborn-darkgrid style: seaborn-deep style: seaborn-muted style...