python - 用 altair 在 2 行之间填充
问题描述
我想突出显示 Altair 中两条线之间的区域。
我试图查看解决方案是否正在使用mark_area()
,但我找不到如何用数据指定下限。
我的数据(几行):
index created pct_pl_transit pct_pl_transit_max
0 1970-01-01 00:00:00 49.627697 60.056873
2 1970-01-01 01:00:00 43.800967 55.301460
4 1970-01-01 02:00:00 41.440480 49.757740
6 1970-01-01 03:00:00 37.879753 40.352226
8 1970-01-01 04:00:00 36.691287 19.429075
我的图表:
base=alt.Chart(lien_traf_gest_traf_lapi).encode(x=alt.X('created', axis=alt.Axis(title='Heure', format='%Hh%M')))
line_pct_pl_lapi=base.mark_line(color='blue').encode(y=alt.Y('pct_pl_transit:Q', axis=alt.Axis(title='Nombre de PL SIREDO')))
line_pct_max=base.mark_line().encode(y='pct_pl_transit_max')
line_pct_max+line_pct_pl_lapi
解决方案
推荐阅读
- c++ - 为什么指针不存储和打印与它应该匹配的对象相同的数据?(C++)
- php - 如何通过ID删除数据库中的数据
- python - 如何使判断碰撞的代码成为乌龟和矩形
- python - 如何拧进度条来复制文件
- performance - 如果列表计数大于 1M,则 Schwartzian 变换不会明显更快
- javascript - JavaScript 中如何实现“数组”?
- javascript - 循环仅将最后一个元素添加到数组中
- java - 获取范围内的 Firebase 文档
- django - 将测试渲染为模板:{% static %} 不起作用
- grails - Spring security UI grails插件用户注册错误