考虑以下最小的不起作用的示例(它是 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 存储库上吗?
正如评论中提到的,这个问题正在解决。临时修复作为参数添加
tooltip=['index']