JackMcKew / pandas_alive

Create stunning, animated visualisations with Pandas & Matplotlib as easy as calling `df.plot_animated()`
MIT License
582 stars 100 forks source link

What happened when I was working on Line Charts, how can I solve it? #29

Closed JianZhe-github closed 2 years ago

JianZhe-github commented 3 years ago

What happened when I was working on Line Charts, how can I solve it? C:\pandas_alive-main\pandas_alive_base_chart.py:458: UserWarning: FixedFormatter should only be used together with FixedLocator ax.set_yticklabels(self.df.columns) C:\pandas_alive-main\pandas_alive_base_chart.py:459: UserWarning: FixedFormatter should only be used together with FixedLocator ax.set_xticklabels([max_val] * len(ax.get_xticks())) C:\pandas_alive-main\pandas_alive\charts.py:516: UserWarning: Discarding nonzero nanoseconds in conversion super().set_x_y_limits(self.df, i, self.ax) And as long as the beginning of my number is too big, there will be some problems

JackMcKew commented 3 years ago

Could you please provide a minimal working example of when this error is thrown

JianZhe-github commented 3 years ago

https://cdn.discordapp.com/attachments/846538797205422093/846539118662254632/4111.gif https://drive.google.com/file/d/1aiK045O1EdAWN5QBp_VTOKqxiiVD48M-/view?usp=sharing This csv file does not match the gif file

JackMcKew commented 3 years ago

Please provide the code you used as well 😄

JianZhe-github commented 3 years ago

https://drive.google.com/file/d/1PmZHb9cP42xeQk6YrZaV_hK2Bsx4i_Al/view?usp=sharing

JackMcKew commented 3 years ago

Here's a colab link using the data and code provided:

https://colab.research.google.com/drive/1CdWi7YFScREJVdhYvgGIAvTBVhIS3V-K?usp=sharing

This does not show the error you specified, please provide code that reproduces the error you're seeing

JianZhe-github commented 3 years ago

https://cdn.discordapp.com/attachments/846538797205422093/846571820023152690/2021-05-24_110500.png

tracer123 commented 3 years ago

UserWarning: Discarding nonzero nanoseconds in conversion super().set_x_y_limits(self.df, i, self.ax)

This can be fixed by adding the warn=False argument to the to_pydatetime() function on line 279 of _base_chart.py.

ax.set_xlim(xlim_start.to_pydatetime(warn=False), xlim_end.to_pydatetime(warn=False))