Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
The Data Visualization Workshop

You're reading from   The Data Visualization Workshop A self-paced, practical approach to transforming your complex data into compelling, captivating graphics

Arrow left icon
Product type Paperback
Published in Jul 2020
Publisher Packt
ISBN-13 9781800568846
Length 536 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Mario Döbler Mario Döbler
Author Profile Icon Mario Döbler
Mario Döbler
Tim Großmann Tim Großmann
Author Profile Icon Tim Großmann
Tim Großmann
Arrow right icon
View More author details
Toc

Basic Text and Legend Functions

All of the functions we discuss in this topic, except for the legend, create and return a matplotlib.text.Text() instance. We are mentioning it here so that you know that all of the properties discussed can be used for the other functions as well. All text functions are illustrated in Figure 3.13.

Labels

Matplotlib provides a few label functions that we can use for setting labels to the x- and y-axes. The plt.xlabel() and plt.ylabel() functions are used to set the label for the current axes. The set_xlabel() and set_ylabel() functions are used to set the label for specified axes.

Example:

ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')

You should (always) add labels to make a visualization more self-explanatory. The same is valid for titles, which will be discussed now.

Titles

A title describes a particular chart/graph. The titles are placed above the axes in the center, left edge, or right edge. There are two...

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 €18.99/month. Cancel anytime