Ejemplo n.º 1
0
    def display_g_function(self):
        if self.all_tweets is None:
            print("No tweets to analyze")
            return
        pattern = self.generate_point_pattern()
        g3 = pattern.compute_g(3)
        x = np.array(list(g3.keys()))
        y = np.array(list(g3.values()))
        g9 = pattern.compute_g(9)
        x4 = np.array(list(g9.keys()))
        y4 = np.array(list(g9.values()))
        g15 = pattern.compute_g(15)
        x2 = np.array(list(g15.keys()))
        y2 = np.array(list(g15.values()))
        g27 = pattern.compute_g(27)
        x3 = np.array(list(g27.keys()))
        y3 = np.array(list(g27.values()))

        plot = PlotWindow.Window()
        plot.plot(x, y, 'G Function(3)', 'red')
        plot.plot(x4, y4, 'G Function(9)', 'violet')
        plot.plot(x2, y2, 'G Function(15)', 'blue')
        plot.plot(x3, y3, 'G Function(27)', 'green')
        plot.exec_()