Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tiago Peixoto
graph-tool
Commits
014d0529
Commit
014d0529
authored
Aug 02, 2009
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small modifications in the quick start guide
parent
7e6968aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
doc/price.py
doc/price.py
+2
-1
doc/quickstart.rst
doc/quickstart.rst
+17
-1
No files found.
doc/price.py
View file @
014d0529
...
...
@@ -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"
)
...
...
doc/quickstart.rst
View file @
014d0529
...
...
@@ -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.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment