Commit 20eb89e8 authored by Tiago Peixoto's avatar Tiago Peixoto

Sync doctests with newer matplotlib

parent 9962dadc
Pipeline #388 passed with stage
in 189 minutes and 49 seconds
......@@ -260,9 +260,9 @@ def corr_hist(g, deg_source, deg_target, bins=[[0, 1], [0, 1]], weight=None,
>>> h = gt.corr_hist(g, "out", "out")
>>> clf()
>>> xlabel("Source out-degree")
<...>
Text(...)
>>> ylabel("Target out-degree")
<...>
Text(...)
>>> imshow(h[0].T, interpolation="nearest", origin="lower")
<...>
>>> colorbar()
......@@ -357,9 +357,9 @@ def combined_corr_hist(g, deg1, deg2, bins=[[0, 1], [0, 1]], float_count=True):
>>> h = gt.combined_corr_hist(g, "in", "out")
>>> clf()
>>> xlabel("In-degree")
<...>
Text(...)
>>> ylabel("Out-degree")
<...>
Text(...)
>>> imshow(h[0].T, interpolation="nearest", origin="lower")
<...>
>>> colorbar()
......@@ -462,9 +462,9 @@ def avg_neighbor_corr(g, deg_source, deg_target, bins=[0, 1], weight=None):
>>> h = gt.avg_neighbor_corr(g, "out", "out")
>>> clf()
>>> xlabel("Source out-degree")
<...>
Text(...)
>>> ylabel("Target out-degree")
<...>
Text(...)
>>> errorbar(h[2][:-1], h[0], yerr=h[1], fmt="o")
<...>
>>> savefig("avg_corr.svg")
......@@ -552,9 +552,9 @@ def avg_combined_corr(g, deg1, deg2, bins=[0, 1]):
>>> h = gt.avg_combined_corr(g, "in", "out")
>>> clf()
>>> xlabel("In-degree")
<...>
Text(...)
>>> ylabel("Out-degree")
<...>
Text(...)
>>> errorbar(h[2][:-1], h[0], yerr=h[1], fmt="o")
<...>
>>> savefig("combined_avg_corr.svg")
......
......@@ -231,9 +231,9 @@ def random_graph(N, deg_sampler, directed=True,
>>> colorbar()
<...>
>>> xlabel("in-degree")
<...>
Text(...)
>>> ylabel("out-degree")
<...>
Text(...)
>>> tight_layout()
>>> savefig("combined-deg-hist.svg")
......@@ -289,9 +289,9 @@ def random_graph(N, deg_sampler, directed=True,
>>> legend(loc='center left', bbox_to_anchor=(1, 0.5))
<...>
>>> xlabel("Source degree")
<...>
Text(...)
>>> ylabel("Average target degree")
<...>
Text(...)
>>> tight_layout()
>>> box = gca().get_position()
>>> gca().set_position([box.x0, box.y0, box.width * 0.7, box.height])
......@@ -700,9 +700,9 @@ def random_rewire(g, model="configuration", n_iter=1, edge_sweep=True,
>>> errorbar(corr[2][:-1], corr[0], yerr=corr[1], fmt="o-", label=r"Erd\H{o}s")
<...>
>>> xlabel("$k$")
<...>
Text(...)
>>> ylabel(r"$\left<k_{nn}\right>$")
<...>
Text(...)
>>> legend(loc='center left', bbox_to_anchor=(1, 0.5))
<...>
>>> tight_layout()
......@@ -762,9 +762,9 @@ def random_rewire(g, model="configuration", n_iter=1, edge_sweep=True,
>>> legend(loc='center left', bbox_to_anchor=(1, 0.5))
<...>
>>> xlabel("Source degree")
<...>
Text(...)
>>> ylabel("Average target degree")
<...>
Text(...)
>>> tight_layout()
>>> box = gca().get_position()
>>> gca().set_position([box.x0, box.y0, box.width * 0.55, box.height])
......
......@@ -114,9 +114,9 @@ def adjacency(g, weight=None, index=None):
>>> scatter(real(ew), imag(ew), c=sqrt(abs(ew)), linewidths=0, alpha=0.6)
<...>
>>> xlabel(r"$\operatorname{Re}(\lambda)$")
<...>
Text(...)
>>> ylabel(r"$\operatorname{Im}(\lambda)$")
<...>
Text(...)
>>> tight_layout()
>>> savefig("adjacency-spectrum.pdf")
......@@ -239,9 +239,9 @@ def laplacian(g, deg="total", normalized=False, weight=None, index=None):
>>> scatter(real(ew), imag(ew), c=sqrt(abs(ew)), linewidths=0, alpha=0.6)
<...>
>>> xlabel(r"$\operatorname{Re}(\lambda)$")
<...>
Text(...)
>>> ylabel(r"$\operatorname{Im}(\lambda)$")
<...>
Text(...)
>>> tight_layout()
>>> savefig("laplacian-spectrum.pdf")
......@@ -263,9 +263,9 @@ def laplacian(g, deg="total", normalized=False, weight=None, index=None):
>>> scatter(real(ew), imag(ew), c=sqrt(abs(ew)), linewidths=0, alpha=0.6)
<...>
>>> xlabel(r"$\operatorname{Re}(\lambda)$")
<...>
Text(...)
>>> ylabel(r"$\operatorname{Im}(\lambda)$")
<...>
Text(...)
>>> tight_layout()
>>> savefig("norm-laplacian-spectrum.pdf")
......@@ -467,9 +467,9 @@ def transition(g, weight=None, index=None):
>>> scatter(real(ew), imag(ew), c=sqrt(abs(ew)), linewidths=0, alpha=0.6)
<...>
>>> xlabel(r"$\operatorname{Re}(\lambda)$")
<...>
Text(...)
>>> ylabel(r"$\operatorname{Im}(\lambda)$")
<...>
Text(...)
>>> tight_layout()
>>> savefig("transition-spectrum.pdf")
......@@ -564,9 +564,9 @@ def modularity_matrix(g, weight=None, index=None):
>>> scatter(real(ew), imag(ew), c=sqrt(abs(ew)), linewidths=0, alpha=0.6)
<...>
>>> xlabel(r"$\operatorname{Re}(\lambda)$")
<...>
Text(...)
>>> ylabel(r"$\operatorname{Im}(\lambda)$")
<...>
Text(...)
>>> tight_layout()
>>> savefig("modularity-spectrum.pdf")
......
......@@ -1303,9 +1303,9 @@ def vertex_percolation(g, vertices):
>>> plot(sizes2, label="Random")
[...]
>>> xlabel("Vertices remaining")
<...>
Text(...)
>>> ylabel("Size of largest component")
<...>
Text(...)
>>> legend(loc="lower right")
<...>
>>> savefig("vertex-percolation.svg")
......@@ -1389,9 +1389,9 @@ def edge_percolation(g, edges):
>>> plot(sizes2, label="Random")
[...]
>>> xlabel("Edges remaining")
<...>
Text(...)
>>> ylabel("Size of largest component")
<...>
Text(...)
>>> legend(loc="lower right")
<...>
>>> savefig("edge-percolation.svg")
......
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