Commit 26903a78 authored by Tiago Peixoto's avatar Tiago Peixoto

Update documentation

parent 83db893e
......@@ -309,6 +309,9 @@ recommended.
print("Improvement:", S2 - S1)
One run of the above code yields a modest improvement, but depending
on the dataset the difference can be larger:
.. testoutput:: celegans-mcmc-combine
Improvement: -82.616161...
\ No newline at end of file
......@@ -25,8 +25,8 @@ we have
.. testoutput:: model-selection
:options: +NORMALIZE_WHITESPACE
Non-degree-corrected DL: 8520.825480...
Degree-corrected DL: 8227.987410...
Non-degree-corrected DL: 8520.825480...
Degree-corrected DL: 8227.987410...
Since it yields the smallest description length, the degree-corrected
fit should be preferred. The statistical significance of the choice can
......
......@@ -8,12 +8,17 @@ as we demonstrate in the following.
.. note::
Since ``graph-tool`` uses `cairo <https://cairographics.org>`_ for
drawing, it is necessary to use matplotlib's cairo backend, otherwise
integration is not possible. The cairo backend can be used by calling:
drawing, it is necessary to one of matplotlib's cairo-based backend,
otherwise integration is not possible. Currently, two backends can be
chosen: ``cairo`` or ``GTK3Cairo``. The latter should be chosen for
interactive GUI-based figures. The backend can be changed by calling
:func:`matplotlib.pyplot.switch_backend`:
.. code::
switch_backend("cairo")
import matplotlib.pyplot as plt
plt.switch_backend("cairo")
Drawing with matplotlib is done by calling
......@@ -26,9 +31,12 @@ Drawing with matplotlib is done by calling
.. testcode::
switch_backend("cairo")
import graph_tool.all as gt
import matplotlib.pyplot as plt
plt.switch_backend("cairo")
fig, ax = subplots(2, 2, figsize=(12, 11.5))
fig, ax = plt.subplots(2, 2, figsize=(12, 11.5))
g = gt.collection.data["polbooks"]
......@@ -57,7 +65,7 @@ Drawing with matplotlib is done by calling
ax[1,1].set_xlabel("$x$ coordinate")
ax[1,1].set_ylabel("$y$ coordinate")
subplots_adjust(left=0.08, right=0.99, top=0.99, bottom=0.06)
plt.subplots_adjust(left=0.08, right=0.99, top=0.99, bottom=0.06)
fig.savefig("gt-mpl.pdf")
......
Markdown is supported
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