What is the difference between draw and draw_networkx in Networkx library?

I was using regular draw function for my graphs and while reading someone's code I saw he used draw_networkx and looks like they are taking different parameters and default values.

I was wondering if anyone could explain me what they are more specifically used for.

1 Answer

Networkx docs give you the answer (bold text is mine):

draw(): draw the graph as a simple representation with no node labels or edge labels and using the full Matplotlib figure area and no axis labels by default. See draw_networkx() for more full-featured drawing that allows title, axis labels etc.

draw_networkx(): draw the graph with Matplotlib with options for node positions, labeling, titles, and many other drawing features. See draw() for simple drawing without labels or axes.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like