def plotGDELT(candidate, start, end): GDELT_counts, dates = GetDailyGDELTCounts.getGDELTCounts(candidate, start, end) #change Nones to 0's i = 0 for count in GDELT_counts: if count == None: GDELT_counts[i] = 0 i += 1 #normalize counts types = AnalysisObjectFactory.createObject("GraphAnalysisNormalized", candidate, "twitter", 'dates go here', GDELT_counts) GDELT_counts = types.getlist_para_two() print 'Normalized: ' + str(GDELT_counts) + '\n' #generate x-axis x = list(range(0, len(GDELT_counts))) line, = plt.plot(GDELT_counts, 'b') global legend legend[0].append(line) legend[1].append('GDELT') return GDELT_counts
def getGDELT(candidate, start, end): counts, dates = GetDailyGDELTCounts.getGDELTCounts(candidate, start, end) return counts