mirror of
https://github.com/vacp2p/wakurtosis.git
synced 2026-01-09 14:58:02 -05:00
plotnet.py
This commit is contained in:
@@ -6,6 +6,7 @@ import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
import sys
|
||||
|
||||
|
||||
def read_network(json_fname, ith=0):
|
||||
with open(json_fname) as f:
|
||||
json_graphs, G = json.load(f), nx.empty_graph()
|
||||
@@ -19,6 +20,7 @@ def read_network(json_fname, ith=0):
|
||||
G.add_edge(src, dst)
|
||||
return G
|
||||
|
||||
|
||||
def plot_network(G, fanout):
|
||||
fig, axes = plt.subplots(1, 2, layout='constrained')
|
||||
fig.set_figwidth(12)
|
||||
@@ -51,7 +53,6 @@ def plot_network(G, fanout):
|
||||
plt.show()
|
||||
|
||||
|
||||
|
||||
def main(ctx: typer.Context,
|
||||
network_data_file: Path = typer.Option("observed_network.json",
|
||||
exists=True, file_okay=True, dir_okay=False, readable=True,
|
||||
@@ -62,6 +63,5 @@ def main(ctx: typer.Context,
|
||||
plot_network(G, fanout)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
typer.run(main)
|
||||
|
||||
Reference in New Issue
Block a user