我有以下模型:
strict digraph graphName {
rankdir="LR";
splines="curved";
age -> intention [label="-"];
attitude -> intention [label="+"];
education -> intention [label="+"];
env_friendly -> intention [label="+"];
knowledge -> intention [label="+"];
male
negative -> intention [label="-"];
neutral
positive -> intention [label="+"];
unsafe -> intention [label="-"];
positive -> env_friendly [dir="both", label="+"];
{ rank = same; age; attitude; education; env_friendly; knowledge; male; negative; neutral; positive; unsafe; }
}
这将显示OK,但是边缘标签关闭,并且双箭头进入节点而不是节点边缘。我该怎么做才能使标签随节点一起返回?
答案 0 :(得分:0)
只需删除行splines = "curved";
即可得到(我想)您想要的:
strict digraph graphName {
rankdir="LR";
# splines="curved";
age -> intention [label="-"];
attitude -> intention [label="+"];
education -> intention [label="+"];
env_friendly -> intention [label="+"];
knowledge -> intention [label="+"];
male
negative -> intention [label="-"];
neutral
positive -> intention [label="+"];
unsafe -> intention [label="-"];
positive -> env_friendly [dir="both", label="+"];
{ rank = same; age; attitude; education; env_friendly; knowledge; male; negative; neutral; positive; unsafe; }
}
收益
提示来自graphviz
的警告
警告:点中不支持带有样条曲线=曲线的边缘标签-请使用xlabels
但关键是不使用xlabels
,而是不使用splines
。