Hi @jakevdp,
I have an error with using title when encoding.
Based on customizing your visualization,
alt.Chart(data).mark_bar(color='firebrick').encode(
alt.Y('a', title='category'),
alt.X('average(b)', title='avg(b) by category')
)
I got an error:
SchemaValidationError: Invalid specification
altair.vegalite.v2.schema.channels.X, validating 'additionalProperties'
Additional properties are not allowed ('title' was unexpected)
The full code in my jupyter looks like this:
import altair as alt
import pandas as pd
data = pd.DataFrame({'a': list('CCCDDDEEE'),
'b': [2, 7, 4, 1, 2, 6, 8, 4, 7]})
alt.Chart(data).mark_bar(color='firebrick').encode(
alt.Y('a', title='category'),
alt.X('average(b)', title='avg(b) by category')
)
Any ideas?
Not anymore a problem after choosing the correct environment. Restarted my notebook and it works now.
In case anyone comes across this on the Googles: this issue came up because the user was using Altair version 2.X, which does not support the title property in encoding channels, rather than version 3.0 or newer, which does support the title property.
Most helpful comment
In case anyone comes across this on the Googles: this issue came up because the user was using Altair version 2.X, which does not support the title property in encoding channels, rather than version 3.0 or newer, which does support the title property.