使用 Polars (Python) 和 Altair 绘图时无法使用“比例”?

问题描述 投票:0回答:1

考虑以下最小的不起作用的示例(它是 Jupyter Notebook): https://github.com/bzm3r/polars-plotting-issue/blob/86e8d926e1ac29feb0cac299e72f85c8e3192f9a/src/polars_plotting_issue/color_scheme.ipynb

我们可以通过两种方式绘制 Polars 数据框:通过 Polars 提供的 API,或者直接使用

altair

看起来,如果我们使用Polars提供的API,我们会遇到直接使用

altair
不会出现的错误:

SchemaValidationError: `Tooltip` has no parameter named 'scale'

Existing parameter names are:
shorthand      bin         format       title   
aggregate      condition   formatType   type    
bandPosition   field       timeUnit             

See the help for `Tooltip` to read the full description of these parameters

这是为什么呢?这应该作为一个问题发布在 Polars 存储库上吗?

python-polars altair
1个回答
0
投票

正如评论中提到的,这个问题正在解决。临时修复作为参数添加

tooltip=['index']

© www.soinside.com 2019 - 2024. All rights reserved.