python - Altair - 条形图中缺少操作按钮
问题描述
Altair 新手(很棒的包!)
在 2 个类似的图表中,一个有操作按钮,而另一个没有。对此有何见解?我想在两者中都有操作按钮(保存到 SVG)。
以下代码:
chart = alt.Chart(df1).mark_bar(size = 25).encode(
x = alt.X('drg3:N',sort=None,
axis = alt.Axis(title = "DRG")),
y = alt.Y('discharges:Q',
axis = alt.Axis(title = "Discharges", format = "s"),
scale = alt.Scale()),
).properties(
title = "Top DRGs, based on Discharges in 2017",
)
chart
生成带有操作按钮的图表
但是,下面的代码
chart = alt.Chart(df1).mark_bar(size = 25).encode(
x = alt.X('drg3:N',sort=None,
axis = alt.Axis(title = "DRG")),
y = alt.Y('disc_times_pay:Q',
axis = alt.Axis(title = "Payments (in '000,000,000s')", format = "s"),
scale = alt.Scale()),
).properties(
title = "Top DRGs, based on Payments in 2017",
)
chart
生成类似的图表,但缺少操作按钮
解决方案
推荐阅读
- javascript - 在 React 类中添加函数的位置 - 在 render() 之前 vs 在 render() 中 vs 在类之外
- enums - 当成员枚举标记位于最外层时,使用 serde 反序列化结构?
- c++ - 类中的 Arduino 步进电机指针不起作用
- c - 是否可以在不创建变量的情况下将结构传递给函数?
- eclipse - 为什么我在 Eclipse 中看不到 Anaconda 库?
- java - 如何制作 TextArea 和列表填充面板?
- java - 带有bom的maven多项目结构
- python - 在新函数中使用函数的结果(加上更多)
- php - 如何使用复选框中的多个值构建 WHERE 条件?
- sql - SQL如何用每个月的数量计算每个项目?