Book Image

Matplotlib 2.x By Example

By : Allen Yu, Claire Chung, Aldrin Yim
Book Image

Matplotlib 2.x By Example

By: Allen Yu, Claire Chung, Aldrin Yim

Overview of this book

Big data analytics are driving innovations in scientific research, digital marketing, policy-making and much more. Matplotlib offers simple but powerful plotting interface, versatile plot types and robust customization. Matplotlib 2.x By Example illustrates the methods and applications of various plot types through real world examples. It begins by giving readers the basic know-how on how to create and customize plots by Matplotlib. It further covers how to plot different types of economic data in the form of 2D and 3D graphs, which give insights from a deluge of data from public repositories, such as Quandl Finance. You will learn to visualize geographical data on maps and implement interactive charts. By the end of this book, you will become well versed with Matplotlib in your day-to-day work to perform advanced data visualization. This book will guide you to prepare high quality figures for manuscripts and presentations. You will learn to create intuitive info-graphics and reshaping your message crisply understandable.
Table of Contents (15 chapters)
Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Two-dimensional faceted plots


We are going to introduce three major ways to create faceted plots: seaborn.factorplot(), seaborn.FacetGrid(), and seaborn.pairplot(). You might have seen some faceted plots in the previous chapter, when we talked about seaborn.lmplot(). Actually, the seaborn.lmplot() function combines seaborn.regplot() with seaborn.FacetGrid(), and the definitions of data subsets can be adjusted by the hue, col, and row parameters.

We are going to introduce three major ways to create faceted plots: seaborn.factorplot(), seaborn.FacetGrid(), and seaborn.pairplot(). These functions actually work similarly to seaborn.lmplot() in the way of defining facets.

Factor plot in Seaborn

With the help of seaborn.factorplot(), we can draw categorical point plots, box plots, violin plots, bar plots, or strip plots onto a seaborn.FacetGrid() by tuning the kind parameter. The default plot type for factorplot is point plot. Unlike other plotting functions in Seaborn, which support a wide variety...