JackMcKew / pandas_alive

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

Barchart race with negative data cannot show properly, the bar with negative data point cannot show in full. #48

Open inlogicwetrust opened 2 years ago

inlogicwetrust commented 2 years ago

Describe the bug With a time series dataset, I have a good portion of data point with negative numbers as shown below. In the rendered bar chart race mp4 file, the bar with negative numbers cannot show in full and trimmed. With all positive numbers, the output is perfect. How could I properly deal with negative numbers when plotting barchart race?

Time Series Data 801010.SI 801030.SI 2022/1/4 0.047342559 -0.008077596 2022/1/5 0.04736944 -0.025241489 2022/1/6 0.038082105 -0.016606611 2022/1/7 0.015604335 -0.033500851 2022/1/10 0.052041332 -0.026741557 2022/1/11 0.025246497 -0.029220364 2022/1/12 0.037713837 -0.014121811 2022/1/13 0.013593648 -0.032819728 2022/1/14 0.00680892 -0.0340062 2022/1/17 0.009693236 -0.027111081 2022/1/18 -0.000276873 -0.027900065 2022/1/19 -0.009540015 -0.04367974 2022/1/20 0.006169156 -0.066530309 2022/1/21 -0.025375526 -0.075732457 2022/1/24 -0.029509801 -0.067858598 2022/1/25 -0.065473694 -0.096090236 2022/1/26 -0.050272572 -0.086760253 2022/1/27 -0.071462749 -0.104737099 2022/1/28 -0.045990452 -0.105897604 2022/2/7 -0.03369515 -0.08711979 2022/2/8 -0.025660463 -0.078520865 2022/2/9 0.002451534 -0.065909109 2022/2/10 0.028961431 -0.061227139 2022/2/11 0.004201477 -0.070694945 2022/2/14 -0.016249476 -0.071849458 2022/2/15 -0.019166048 -0.068753446 2022/2/16 -0.027017946 -0.05653718 2022/2/17 -0.017139232 -0.04423902 2022/2/18 -0.006085825 -0.041314787 2022/2/21 -0.002489167 -0.0375776 2022/2/22 -0.008935196 -0.036105496 2022/2/23 -0.023493866 -0.012891396 2022/2/24 -0.039603561 -0.033650658 2022/2/25 -0.038563272 -0.027248903 2022/2/28 -0.038743374 -0.019093408

Reproduce DF.plot_animated(filename = 'd:/test.mp4', steps_per_period = 15, figsize = np.array([20, 10]), orientation='v')

tarek-kerbedj commented 3 months ago

did you find any solution to this ?