Skip to content

Instantly share code, notes, and snippets.

@lpillmann
Last active September 26, 2022 22:07
Show Gist options
  • Save lpillmann/d6cf5e992195bd0eb8c3e86ac27f3dc3 to your computer and use it in GitHub Desktop.
Save lpillmann/d6cf5e992195bd0eb8c3e86ac27f3dc3 to your computer and use it in GitHub Desktop.
Custom Altair theme to enlarge font size and make it comfortably readable
import altair as alt
# Custom theme for readability
def readable():
return {
"config" : {
"title": {'fontSize': 16},
"axis": {
"labelFontSize": 14,
"titleFontSize": 14,
},
"header": {
"labelFontSize": 14,
"titleFontSize": 14,
},
"legend": {
"labelFontSize": 14,
"titleFontSize": 14,
},
"mark": {
'fontSize': 14,
"tooltip": {"content": "encoding"}, # enable tooltips
},
}
}
alt.themes.register('readable', readable)
alt.themes.enable('readable')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment