Skip to content

Commit

Permalink
Merge pull request #71 from larsgrobe/master
Browse files Browse the repository at this point in the history
Add fname to plot_network to specify output filename.
  • Loading branch information
stijnh authored Jan 4, 2024
2 parents cd270b4 + dbe9cd2 commit 27919ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions litstudy/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def plot_network(
controls=False,
scale=1,
iterations=1000,
gravity=1
gravity=1,
file_name="network.html"
):
"""Plot a `networkx.Graph` generated by one of the `build_X_graph`
functions in this module. Plotting is done using the `pyvis` library.
Expand All @@ -53,6 +54,7 @@ def plot_network(
:param max_node_size: The radius of the largest node.
:param largest_component: Only plot the largest connected component of
the graph.
:param file_name: The name of the file where the plot will be saved.
"""
isolates = list(nx.isolates(g))
if isolates:
Expand Down Expand Up @@ -152,7 +154,7 @@ def plot_network(
)
)

return v.show("citation.html")
return v.show(file_name)


def build_base_network(
Expand Down

0 comments on commit 27919ae

Please sign in to comment.