diff --git a/doc/price.py b/doc/price.py index d7053a521f1aa49df528ce7bf710444c410043ee..057074989f9ff1aa502fe6c796465fc60398ff44 100755 --- a/doc/price.py +++ b/doc/price.py @@ -57,9 +57,10 @@ for i in xrange(1, N): in_hist = vertex_hist(g, "in") clf() -errorbar(in_hist[1], in_hist[0], fmt=".", yerr=sqrt(in_hist[0])) +errorbar(in_hist[1], in_hist[0], fmt="o", yerr=sqrt(in_hist[0]), label="in") gca().set_yscale("log") gca().set_xscale("log") +legend(loc="best") xlabel("\$k_{in}\$") ylabel("\$P(k_{in})\$") savefig("deg-hist.png") diff --git a/doc/quickstart.rst b/doc/quickstart.rst index ceae6c6a4169282fc0a242382f19f5fb54e35733..1b0ce36c204e65c1c9452258d05a2a26db908c9d 100644 --- a/doc/quickstart.rst +++ b/doc/quickstart.rst @@ -334,5 +334,21 @@ An Example: Building a Price Network Nowhere else to go... We found the main hub! -.. image:: deg-hist.png +.. figure:: deg-hist.png + :align: center + In-degree distribution of a price network with 100000 nodes. + +We can draw the graph to see some other features of its topology. For that we +use the :func:`~graph_tool.draw.graph_draw` function. + +.. testcode:: + + g = load_graph("price.xml.gz") + g.remove_vertex_if(lambda v: g.vertex_index[v] >= 1000) + gt.graph_draw(g, output="price.png") + +.. figure:: price.png + :align: center + + First 1000 nodes of a price network.