Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Matplotlib 2.x By Example

You're reading from  Matplotlib 2.x By Example

Product type Book
Published in Aug 2017
Publisher Packt
ISBN-13 9781788295260
Pages 334 pages
Edition 1st Edition
Languages
Authors (3):
Allen Yu Allen Yu
Profile icon Allen Yu
Claire Chung Claire Chung
Profile icon Claire Chung
Aldrin Yim Aldrin Yim
Profile icon Aldrin Yim
View More author details

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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}