matplotlib / matplotlib/mplfinance
`tz_localize=True` fails to localize datetimes in `tlines` and `alines` specifications (and in the future also in xlim specification?)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 678
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I tried to implement the tlines using mplfinance, and generate the trendline data as per the example, however, I still get this error:
ValueError:
tlines date pair (2021-01-11 09:35:00-05:00,2021-01-11 10:20:00-05:00) too close, or wrong order, or out of range!
df date range: [2021-01-11 09:35:00+00:00 , 2021-01-11 10:20:00+00:00]
Please, if anyone can advise, It will be much appreciated.
Regards.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported error with timezone-aware datetimes in the tlines and alines specifications, using the example referenced in the issue. Inspect how tz_localize=True is handled for these specifications, and verify that the date pair is accepted when its timezone differs from the dataframe range; xlim behavior is noted as future work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100