import pandas as pd
import pandas_alive
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
plt.style.use('ggplot')
elec_df=pd.read_csv("D:\Aus_Elec_Gen_1980_2018.csv",index_col=0,parse_dates=[0],thousands=',')
#缺省值0填充、绘图
ax_main=elec_df.fillna(0).plot_animated(
'electricity-generated-australia.gif',
period_fmt="%d/%m/%Y",
title='Australian Electricity Sources 1980-2018',
perpendicular_bar_func='mean',
cmap='Set1',
n_isible=5,
orientation='h',)
最终警告:
d:\Users\zhang\Anaconda3\lib\site-packages\pandas_alive\charts.py:221: UserWarning: FixedFormatter should only be used together with FixedLocator
ax.set_yticklabels(self.df.columns)
d:\Users\zhang\Anaconda3\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()))
请问怎么解决呢
相似问题