#

Note

This documents the development version of NetworkX. Documentation for the current release can be found here.

#

networkx.drawing.nx_pydot.from_pydot

from_pydot(P)[source]

Returns a NetworkX graph from a Pydot graph.

Parameters

P (Pydot graph) – A graph created with Pydot

Returns

G – A MultiGraph or MultiDiGraph.

Return type

NetworkX multigraph

Examples

>>> K5 = nx.complete_graph(5)
>>> A = nx.nx_pydot.to_pydot(K5)
>>> G = nx.nx_pydot.from_pydot(A)  # return MultiGraph

# make a Graph instead of MultiGraph >>> G = nx.Graph(nx.nx_pydot.from_pydot(A))