示例#1
0
 def testClust(self):
     clusts = list(self.graph.clustering_indices(self.nodes))
     p = Plot()
     p.clear()
     p.title = 'Clustering index distribution'
     p.x_label = 'c : node clustering index'
     p.y_label = 'P(c)'
     _, _ = p.dist_plot(clusts, 10, True, True, True)
     #p.show()
     pass
示例#2
0
    def testGraphHistogram(self):
        self.graph = Graph()
        self.graph.debug = False
        self.graph.input_debug_links = 200000
        self.graph.output_debug_nodes = 10000
        self.graph.load_edgelist(StringIO(example_txt2))

        degrees = list(self.graph.degrees())
        p = Plot()
        p.clear()
        p.hist(degrees, 15, True, True, False)
示例#3
0
    def testDegree(self):

        degrees = list(self.graph.degrees(self.nodes))
        p = Plot()
        p.clear()
        p.title = 'Degree distribution'
        p.x_label = 'd : node degree'
        p.y_label = 'P(d)'
        p.dist_plot(degrees, 10, True, True, True)
        #p.show()
        pass
示例#4
0
    def testPlotSave(self):
        self.graph = Graph()
        self.graph.debug = False
        self.graph.input_debug_links = 200000
        self.graph.output_debug_nodes = 10000
        self.graph.load_edgelist(StringIO(example_txt))

        clusts = list(self.graph.eccentricities())
        clusts
        p = Plot()
        p.clear()
        p.hist(clusts, 3, True, True, True)
        p.save('testPlotSave.png')
示例#5
0
 def testBasicHistogram(self):
     x = map(lambda x: 2**x, range(0, 5))
     p = Plot()
     p.clear()
     p.hist(x, 4, False, False, False)
示例#6
0
 def testPlot2D(self):
     x = range(0, 5) + [1]
     y = map(lambda x: 2**x, range(0, 5)) + [3]
     p = Plot()
     p.clear()
     p.dist_plot_2d(x, y, 5, False)