我想知道如何最好地生成示意图,类似使用Python NetworkX库),其中包含每个节点(城市)的纬度和经度,以及在印度铁路网络中连接它们的线路。
- 城市(节点)的位置应合理地靠近其实际位置,但不一定准确地定位。我可以使用 platecarrée投影,该投影只能将lat/long映射到图中的x/y上。
- 铁路线(边缘)可以是直线,甚至可以曲线效果更好。
- 该图应与每个行连接的线(最大4个字符)标签一起显示城市(最好用作点),每行的单个标签(给定的示例都有很长的标签,用于行)) 。
- 最好将坐标的手动调整量最小化。
使用GraphViz是我的第一个想法。但是我不知道NEATO/FDP(节点的固定定位所需的)将使用大量节点/边缘执行。同样,将GraphViz显示标签在节点外(而不是直列)外分别制作,似乎需要每个标签的手动定位,这很无聊。有什么更好的方法可以获取这种布局吗?
I would like to know how best to generate a schematic diagram, something like this, from a graph (created using the Python NetworkX library) that contains the latitude and longitude of each node (city) and the lines connecting them in the Indian railway network.
- The cities (nodes) should be located reasonably close to their actual position, but not necessarily exactly. I am OK with using the plate carrée projection that simply maps lat/long onto X/Y in the diagram.
- The rail lines (edges) can be straight lines or even curves if it fits better.
- On the diagram should be displayed the cities (preferably as dots) along with a short (max 4 characters) label for each, the lines connecting them, and a single label for each line (the given example has quite long labels for the lines).
- Preferably the amount of manual tweaking of coordinates to get things to fit should be minimised.
Using Graphviz was my first idea. But I don't know how well neato/fdp (required for fixed positioning of nodes) will perform with large numbers of nodes/edges. Also, making Graphviz display labels separately outside the nodes (rather than inline) seems to need a lot of manual positioning of each label, which would be pretty boring. Is there any better way to get this kind of layout?
发布评论
评论(1)
可行(),但似乎没有使用许多GraphViz功能。除链接中提到的工具外,也可以考虑 pikchr ()
Doable (https://forum.graphviz.org/t/another-stupid-graphviz-trick-geographic-graphs/256), but does not seem to use many Graphviz features. In addition to tools mentioned in the link, maybe consider pikchr (https://pikchr.org/home/doc/trunk/homepage.md)