我正在使用networkx绘制3D立方体、4D超立方体和5D超立方体。在
如何控制draw()函数的工作方式?我希望他们都出来在完全相同的角度,大小和标签。在
cnt = 0
for uniqHC in nx_hcl:
plt.figure()
nx.draw(uniqHC)
plt.savefig("uniqHC_" + str(cnt))
plt.close()
#nx.relabel_nodes(uniqHC, flatten)
cnt += 1
如你所见,第一个还不错,第二个不是我想要的。很难理解和比较正在发生的事情。这只是三维的
这个软件可以绘制超立方体,它们看起来很棒。我希望我的图表以同样的风格绘制。下面是我想要的3D手机壳的图片。我只标注“000”、“001”就可以了。我试过聪明点,从它们的超立方体开始,去掉有向边,再加上我的方向,但它随机地扭曲了图形的形状,看起来和以前一样!在
^{pr2}$
在networkx中使用spring布局方法可能无法获得所需的结果(一致的方向和间距)。这是默认值,也是调用draw()时发生的情况。在
如果您知道要将节点定位到何处,可以像这样指定
相关问题 更多 >
编程相关推荐