Open
Description
Description
Currently, when using Arabic text in Matplotlib plots (titles, labels, legends), the text appears incorrectly due to:
- Left-to-right rendering instead of proper right-to-left.
- Arabic characters are shown as disconnected (e.g., "ت ش ا ت" instead of "تشات").
- Usage of fonts that lack Arabic support, resulting in broken symbols or empty boxes.
This greatly affects the usability of Matplotlib for Arabic-speaking users in scientific, academic, and educational contexts.
Proposed Solution
To resolve this issue, we propose the following enhancements:
-
Integrate Arabic reshaping and bidi support:
- Use
arabic_reshaper
to properly shape Arabic characters. - Use
python-bidi
to ensure correct text direction.
- Use
-
Support Arabic-compatible fonts such as:
- Amiri
- Noto Naskh Arabic
- Lateef
- Cairo
-
Auto-detect Arabic text and apply shaping + direction correction internally (if feasible).
Visual Example
The following image shows a real example of the issue where Arabic text is rendered incorrectly in a plot:
(please see attached image or PDF)
Attached PDF Report
A full report is attached with:
- Bilingual description (Arabic + English)
- Proposed technical solution
- Plot illustration of the current rendering issue
Environment
- Matplotlib version: [please fill]
- Python version: [please fill]
- OS: [please fill]
Thank you for your efforts and for supporting internationalization!