问题
Given two lists, which contain same elements of string but in different orders, is there any API that can draw diagrams like

The diagram consists of two stacks of string. Between these two stacks, lines are used to link same elements between these two stacks.
Its outlook is similar as the visualization of sonar (an Eclipse code diff. tool), but the semantics of lines are different.
Does this kind of diagram have some formal name?
回答1:
The general graph description format DOT seems the most appropriate to me: it is easy to describe a huge variety of graphs, with this (text) format, and you can plot them with one of the many tools available (Graphviz comes to mind, for example).
You also have the specialized python-graph module at your disposal (which can work with the DOT format too).
回答2:
With python you have many options, see here for more. I would recommend matplotlib, take a look at this example.
来源:https://stackoverflow.com/questions/7528224/is-there-a-python-api-for-drawing-diagrams-that-use-lines-to-connect-correspond