使用Python或graphviz的fishbone(鱼骨)图

2024-09-30 16:34:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试用Python生成鱼骨图(因果图或Ishikawa图)。有没有办法让它更像标准鱼骨图?在

from graphviz import Digraph

A=[('HW', 'Root'), ('SW', 'Root'),
  ('Electric', 'HW'), ('ink', 'HW'), ('windows', 'SW'), ('Drivers', 'SW'),
  ('Yellow', 'ink'), ('blue', 'ink'), ('pink', 'ink'),
  ('FE', 'Drivers'), ('BE', 'Drivers')]
e = Digraph()
e.attr(rankdir='LR')
for a in A:
    e.node(a[0])
    e.edge(a[0], a[1])
e.view()

enter image description here

enter image description here


Tags: fromimport标准windowsrootswgraphvizink