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

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.

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest