我试着从一个列表(y轴)中连续地绘制数据点与列表的长度(“my_list”)。我很困惑matplotlib是否有可能不必每次都关闭图形窗口就可以连续地绘制图形?同时,是否有可能将变量“平均值”与变量“len(my_list)”对应起来。在
这是我的代码:from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import json
from textblob import TextBlob
import matplotlib.pyplot as plt
# Variables that contains the user credentials to access Twitter API
access_token = ""
access_token_secret = ""
consumer_key = ""
consumer_secret = ""
# This is a basic listener that just prints received tweets to stdout.
my_list = [] #creates empty list
class StdOutListener(StreamListener):
def on_data(self, data):
json_load = json.loads(data)
texts = json_load['text'] # string
#coded = texts.encode(