在jupyter笔记本中运行matplotlib,但错误为<图大小432x288带有0个轴>

问题描述

我正在jupyter笔记本中运行代码,但没有得到图形,而是一个味精说

import random
from itertools import count
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
plt.style.use('fivethirtyeight')


x_vals=[]
y_vals=[]
index=count()

def animate(i):
    x_vals(next(index))
    y_vals(random.randint(0,5))
    
    plt.plot(x_vals,y_vals)

ani=FuncAnimation(plt.gcf(),animate,interval=1000)
plt.tight_layout()
plt.show()

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)