configure_title() is an Altair method for setting global visual properties on chart titles. It customizes color, font size, font family, offset, and horizontal anchor. section 3.2.6
Use it after defining a chart when the default title does not provide the desired visual emphasis or spacing. The anchor accepts None, start, middle, or end. section 3.2.6 section 5.1.1
Styling a chart title
chart = chart.configure_title( fontSize=20, color='#80C11E', offset=30, anchor='start' ) chart.save('configure-title.html') This changes the title’s size, color, distance from the chart, and alignment. A population chart later combines configure_title() with configure_axis() and configure_view() for a consistent presentation. section 3.2.6 section 3.3.1
Listing 3.21 Configuring title
chart = chart.configure_title(
fontSize=20, #1
color='#80C11E', #2
offset=30, #3
anchor='start' #4
)
chart.save('configure-title.html')
Inspect the complete title-configuration listing and compare its resulting layout with the unconfigured chart. section 3.2.6
Title styling supports communication, but it does not correct misleading data. A homelessness chart still requires population normalization before its visual conclusion is trustworthy. section 5.1.1
