Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"nb2plots",
"texext",
"numpydoc",
"IPython.sphinxext.ipython_directive",
"matplotlib.sphinxext.plot_directive",
]

# https://github.com/sphinx-gallery/sphinx-gallery
Expand Down Expand Up @@ -240,6 +242,36 @@

numpydoc_show_class_members = False

# Make numpydoc to generate plots for example sections
numpydoc_use_plots = True

plot_pre_code = """
import networkx as nx
"""

plot_include_source = True
plot_formats = [("png", 100), "pdf"]

import math

phi = (math.sqrt(5) + 1) / 2

plot_rcparams = {
"font.size": 8,
"axes.titlesize": 8,
"axes.labelsize": 8,
"xtick.labelsize": 8,
"ytick.labelsize": 8,
"legend.fontsize": 8,
"figure.figsize": (3 * phi, 3),
"figure.subplot.bottom": 0.2,
"figure.subplot.left": 0.2,
"figure.subplot.right": 0.9,
"figure.subplot.top": 0.85,
"figure.subplot.wspace": 0.4,
"text.usetex": False,
}


def setup(app):
app.add_css_file("custom.css")
Expand Down
6 changes: 6 additions & 0 deletions networkx/generators/classic.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ def complete_graph(n, create_using=None):
>>> G.is_directed()
True

$K_5$ with a circular layout

>>> import matplotlib.pyplot as plt
>>> G = nx.complete_graph(5)
>>> nx.draw_circular(G)
>>> plt.show();
"""
_, nodes = n
G = empty_graph(nodes, create_using)
Expand Down