笨鸟快飞呀 2021-08-08 11:56 采纳率: 50%
浏览 1590

求解决 执行pandas_alive时报错:FixedFormatter should only be used together with FixedLocator

从网上都有这段代码,但是就我的报错:
搞了好久了,毫无头绪
解决后 直接给悬赏

import pandas_alive
import pandas as pd

covid_df = pd.read_csv('data/covid19.csv', index_col=0, parse_dates=[0])
covid_df.plot_animated(filename='examples/example-barh-chart.gif', n_visible=15)

报错:

C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\python.exe C:/wj/aoyu/ayu.py
Generating BarChartRace, plotting ['Belgium', 'Brazil', 'Canada', 'China', 'France', 'Germany', 'India', 'Indonesia', 'Iran', 'Ireland', 'Italy', 'Mexico', 'Netherlands', 'Portugal', 'Spain', 'Sweden', 'Switzerland', 'Turkey', 'USA', 'United Kingdom']
C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas_alive\charts.py:221: UserWarning: FixedFormatter should only be used together with FixedLocator
  ax.set_yticklabels(self.df.columns)
C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas_alive\charts.py:222: UserWarning: FixedFormatter should only be used together with FixedLocator
  ax.set_xticklabels([max_val] * len(ax.get_xticks()))
C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\matplotlib\animation.py:973: UserWarning: Animation was deleted without rendering anything. This is most likely unintended. To prevent deletion, assign the Animation to a variable that exists for as long as you need the Animation.
  warnings.warn(

Process finished with exit code 0
  • 写回答

3条回答 默认 最新

  • 尘世镜花恋 2021-08-08 12:10
    关注

    问题描述:这是一个用户警告,它告诉FixedFormatter(刻度形式) 只能与 FixedLocator定位器 一起使用,而不能使用其他方法改变刻度形式。

    评论

报告相同问题?

问题事件

  • 创建了问题 8月8日