Commit 014d0529 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Small modifications in the quick start guide

parent 7e6968aa
...@@ -57,9 +57,10 @@ for i in xrange(1, N): ...@@ -57,9 +57,10 @@ for i in xrange(1, N):
in_hist = vertex_hist(g, "in") in_hist = vertex_hist(g, "in")
clf() 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_yscale("log")
gca().set_xscale("log") gca().set_xscale("log")
xlabel("$k_{in}$") xlabel("$k_{in}$")
ylabel("$P(k_{in})$") ylabel("$P(k_{in})$")
savefig("deg-hist.png") savefig("deg-hist.png")
...@@ -334,5 +334,21 @@ An Example: Building a Price Network ...@@ -334,5 +334,21 @@ An Example: Building a Price Network
Nowhere else to go... We found the main hub! 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.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment