I am plotting a 3d plot in python 2.7
When I try to plot a 3d plot with color and marker as in 2D plot() function. I come across an error.
So I tried to plot line separately and measured points with markers separately using scatter() function.
When I create legend entries my legend looks like this
But I don't want to have duplicate legend entries instead
我最近开始在 python 中使用 networkx 库来生成和可视化图表。我从一个简单的代码(由 4 个节点组成)开始,如图所示
import networkx as nx
import matplotlib.pyplot as plt
G = nx.Graph()
G.add_edges_from([(1 ,2) , (2 ,3) , (1 ,3) , (1 ,4) ])
nx.draw(G)
plt.show()
Run Code Online (Sandbox Code Playgroud)
当我连续两次运行代码时,相同代码的输出如图所示(图的方向是随机的)

是否可以生成具有相同/固定方向的图的输出?