Last active
September 26, 2022 22:07
-
-
Save lpillmann/d6cf5e992195bd0eb8c3e86ac27f3dc3 to your computer and use it in GitHub Desktop.
Custom Altair theme to enlarge font size and make it comfortably readable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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