liveBook · Manning

TitleParams()

As explained in Data Storytelling with Altair and AI

TitleParams() is an Altair configuration object for specifying chart title text and related title properties.

TitleParams() configures an Altair chart title and related context, including title text, subtitles, font sizes, and spacing. It helps turn a chart from information into a more understandable data story. section 5.2.2 section 5.5.2

Use TitleParams() to control presentation details such as:

  • title: the main chart heading, supplied as text or multiple text lines. section 5.2.2
  • subtitle: explanatory context that guides attention toward the data. section 5.2.2 section 5.5.2
  • subtitleFontSize and fontSize: text sizing for subtitles and titles. section 5.2.2

Adding context to a homelessness chart

chart = chart.properties( width=500, title=alt.TitleParams( text=["Together, Let's Make a Difference:", "Support Our Project to Help the Homeless!"], subtitle=[ "Homelessness is a heartbreaking reality that leaves individuals and families without a stable home,", "leading to devastating consequences such as poor health and social isolation.", "The chart describes the number of homeless people in Italy per 1,000 inhabitants, organized by region.", "The data is from 2021, the most recent year available (Source: ISTAT)." ], subtitleFontSize=18 ) ) The title states the appeal, while the subtitle supplies human and statistical context.

How Data Storytelling with Altair and AI covers it

How deep it goes
Demonstrates title, subtitle, font-size, and offset parameters through runnable examples without cataloging every available option.
Examples
Uses homelessness and fake-news charts to demonstrate contextual subtitles, multiline titles, font sizing, and spacing.
What it assumes
Assumes a chart object and basic Altair properties usage while demonstrating TitleParams() from the configuration step.
What you can do after
Apply it via Altair chart properties to build clearer, audience-focused titles and subtitles.
How it connects
Connects chart properties, subtitles, textual annotations, data storytelling, and visual context.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Storytelling with Altair and AI. The section links point to the parts of the book it draws on.