有没有办法在 altair 中设置全局首选项?
Is there a way to set global preferences in altair?
有没有办法用 Altair 做类似 rc 文件的事情?
我目前在笔记本的开头创建一个Altair主题(设置绘图大小和字体大小等),然后注册并启用它。
alt.themes.register('my-chart', my_theme)
alt.themes.enable('my-chart')
将其重构为某种全局配置文件的最佳方法是什么?
我认为没有 Altair 在启动时读取的文件。如果你想避免将相同的主题代码复制粘贴到每个笔记本中,你可以用你的主题创建一个 Python 包。有several examples of how to set this up on GitHub e.g. this la times theme.
有没有办法用 Altair 做类似 rc 文件的事情?
我目前在笔记本的开头创建一个Altair主题(设置绘图大小和字体大小等),然后注册并启用它。
alt.themes.register('my-chart', my_theme)
alt.themes.enable('my-chart')
将其重构为某种全局配置文件的最佳方法是什么?
我认为没有 Altair 在启动时读取的文件。如果你想避免将相同的主题代码复制粘贴到每个笔记本中,你可以用你的主题创建一个 Python 包。有several examples of how to set this up on GitHub e.g. this la times theme.