2
我可以使用“记录”来绘制一个阵列像这样的:的Graphviz画数组
graph G{
node [shape = record];
node0 [fontsize=13, label ="A[0]|A[1]|A[2]"];
}
但如何我可以得出这样的一个 http://sites.tufts.edu/comp15/files/2013/06/pic2_1darrays1.png
特别是,我怎么能添加数组中每个单元格的索引号,如0,1,2,3,4,5。
我应该使用哪种节点形状?
更新于2016年11月11日
好吧,我得到了基于答案从https://stackoverflow.com/a/37986662/5374561
它的代码是在这里:
digraph so
{
rankdir=LR;
subgraph cluster0
{
rank = same{ Array notes }
color = white;
Array [ shape = record, label = "{ A | B | C | D }"] ;
notes [ shape = record, color = white, label = "{ 0 | 1 | 2 | 3 }" ];
Array -> notes[ style = invis ];
}
nodesep = .0;
}
但结果是不完善。还有其他方法吗?
更新在2016/8/9
从tequlia2pop解决方案(谢谢)是接近原始照片,而是从“指针”行至“价值”应该是一条直线。