At last! There are subtitles in for altair charts(via a vega-lite update)! How splendid! This issue identifies a documentation bug and maybe a styling bug revolving around this newly birthed feature:
I don't believe that there is any documentation of the mechanism for adding subtitles (or multiline titles) to charts! It's a great feature it should be easy to find!
The title configuration section of the documentation appears to suggest that there should be various subtitle styling operators (subtitleColor, subtitleFont, subtitleFontSize, subtitleFontStyle, subtitleFontWeight, subtitleLineHeight, subtitlePadding specifically), but all of the variations that i've tried on them appear not to work? For instance the following should ostensibly produce a chart with a red subtitle
import altair as alt
from vega_datasets import data
chart = alt.Chart(data.cars.url).mark_point().encode(
x='Horsepower:Q',
y='Miles_per_Gallon:Q',
).properties(
title={
"text": ["First line of title", "Second line of title"],
"subtitle": ["Cool first line of subtitle", "Even cooler second line wow dang"]
}
)
chart.configure_title(
fontSize=20,
font='Courier',
anchor='start',
color='gray',
subtitleColor='red'
)
Unfortunately it produces a chart with an unstyled subtitle:

I totally admit that i might be misreading this, but, if not, it seems like a bug. I'm happy to help contribute documentation once a solution is known
It looks like a bug that should be reported upstream to Vega-Lite
Reported to upstream!
Apparently it is both a documentation bug and a regular bug, after a helpful hint from @domoritz on the upstream issue, I was able to get the styling applied to the subtitle like so:
import altair as alt
from vega_datasets import data
chart = alt.Chart(data.cars.url).mark_point().encode(
x='Horsepower:Q',
y='Miles_per_Gallon:Q',
).properties(
title={
"text": ["First line of title", "Second line of title"],
"subtitle": ["Cool first line of subtitle", "Even cooler second line wow dang"],
"color": "red",
"subtitleColor": "green"
}
)
chart
@jakevdp, I'm interested in the idea of adding examples to the gallery that tackle basic customizations like adding a subtitle. Would you be open to a new section there that showed how to do something like this? It seems like it would pretty tough for a newbie to figure out.
Sure, that would be great
I think a narrative documentation section would be better than more gallery examples. The gallery is already pretty crowded, and it's not always easy to find the relevant chart.
Most helpful comment
Apparently it is both a documentation bug and a regular bug, after a helpful hint from @domoritz on the upstream issue, I was able to get the styling applied to the subtitle like so: