Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Matplotlib for Python Developers. - Second Edition

You're reading from  Matplotlib for Python Developers. - Second Edition

Product type Book
Published in Apr 2018
Publisher Packt
ISBN-13 9781788625173
Pages 300 pages
Edition 2nd Edition
Languages
Authors (3):
Aldrin Yim Aldrin Yim
Profile icon Aldrin Yim
Claire Chung Claire Chung
Profile icon Claire Chung
Allen Yu Allen Yu
Profile icon Allen Yu
View More author details

Table of Contents (16) Chapters

Title Page
Dedication
Packt Upsell
Contributors
Preface
Introduction to Matplotlib Getting Started with Matplotlib Decorating Graphs with Plot Styles and Types Advanced Matplotlib Embedding Matplotlib in GTK+3 Embedding Matplotlib in Qt 5 Embedding Matplotlib in wxWidgets Using wxPython Integrating Matplotlib with Web Applications Matplotlib in the Real World Integrating Data Visualization into the Workflow Index

Controlling the colors


Color is an essential element in any visual. It can have a huge impact on how graphics are perceived. For example, sharp color contrast can be used to highlight a focus; a combination of several distinct colors is useful in setting up a hierarchy.

In Matplotlib 2, colors have been set by default to better differentiate between categories; and to perceive continuous numerical values more intuitively, yet we often need better control over the colors to represent our data. In this section, we will introduce the common color options in Matplotlib.

Default color cycle

A color cycle is a list of colors used to control the color of a series of elements automatically, such as each data series in multiline plots. In Matplotlib 2.0, the default color cycle has expanded from 7 to 10 colors using the category10 palette in Data-Driven Documents (D3) https://github.com/d3 and Vega, a declarative language for visualization grammar. These colors are designed to show good contrast between...

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 $15.99/month. Cancel anytime}