【发布时间】:2020-10-16 20:40:47
【问题描述】:
我正在尝试通过沿该路线的各个边缘的属性为路线着色,这在早期版本的 osmnx 中使用以下语法是可能的:
# just an example graph
G = ox.graph_from_point((42.35083, -71.089473), network_type='drive', dist_type='network',
simplify=False, dist=100)
# example route
route = [61354688, 7542547660, 5674166794, 61354678]
# color for each edge (4 nodes, 3 edges)
rcs = ['r', 'b', 'r']
ox.plot_graph_route(G, route, route_color=rcs)
这会引发以下错误:
ValueError: 'c' argument has 3 elements, which is not acceptable for use with 'x' with size 2, 'y' with size 2.
我不确定以前是如何实现的,但它似乎可以采用与路线中的边缘相同数量的元素并相应地颜色的列表。有没有一种新的方法来实现这一点?似乎可以通过特定属性为整个图表着色,但不能通过单个路线。
任何帮助将不胜感激!
【问题讨论】:
标签: osmnx