簡體   English   中英

如何打印 Altair 默認配置的字典

[英]How to print a dict of Altair's default configuration

我正在嘗試打印Altair默認配置的字典(或列表)。 在模塊文檔中,我發現了一個名為altair.Config()的 object,我認為它會包含 Altair 的默認配置。 我嘗試了以下方法:

import altair as alt
conf = alt.Config()
print(conf.to_dict())

但它只是打印一個空字典。

如何打印 Altair 的默認配置? 具體來說,我想知道默認字體的名稱(我在文檔中也找不到)。

Altair 中沒有定義默認字體。 Altair 的默認設置位於其默認主題中:

>>> import altair as alt
>>> theme = alt.themes.get()
>>> theme()
{'config': {'view': {'continuousHeight': 300, 'continuousWidth': 400}}}

渲染圖表時,其他所有內容都由 Vega-Lite 或 Vega 定義。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM