From 014d052904b3f3548310ddf77f7e95d23762d6ce Mon Sep 17 00:00:00 2001 From: Tiago de Paula Peixoto Date: Sun, 2 Aug 2009 21:37:22 +0200 Subject: [PATCH] Small modifications in the quick start guide --- doc/price.py | 3 ++- doc/quickstart.rst | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/doc/price.py b/doc/price.py index d7053a52..05707498 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 ceae6c6a..1b0ce36c 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. -- GitLab