Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Description
Bug summary
Hello. When plotting time series data using Matplotlib and Pandas, I have observed a significant difference in execution times between plots with and without timezones.
Code and Observation:
I have provided a code snippet below for reference:
Code for reproduction
importmatplotlib.pyplotaspltn=1000000vertical= [iforiinrange(n)]# Prepare the datadates_no_tz=pd.date_range('2019-01-01',periods=n,freq='T')dates_with_tz=pd.date_range('2019-01-01',periods=n,freq='T',tz='UTC')# Plot the time series without timezone%timeplt.plot(dates_no_tz,vertical)# Plot the time series with timezone%timeplt.plot(dates_with_tz,vertical)
Actual outcome
CPU times: user 50.6 ms, sys: 19.1 ms, total: 69.7 ms
Wall time: 71.2 ms
CPU times: user 3.44 s, sys: 192 ms, total: 3.63 s
Wall time: 3.69 s
Expected outcome
Expect a similar execution time
Additional information
No response
Operating system
No response
Matplotlib Version
3.8.0
Matplotlib Backend
module://matplotlib_inline.backend_inline
Python version
Python 3.9.18
Jupyter version
No response
Installation
pip