Title: [Feature Request] Proper Arabic Language Support in Matplotlib Plots · Issue #29806 · matplotlib/matplotlib · GitHub
Open Graph Title: [Feature Request] Proper Arabic Language Support in Matplotlib Plots · Issue #29806 · matplotlib/matplotlib
X Title: [Feature Request] Proper Arabic Language Support in Matplotlib Plots · Issue #29806 · matplotlib/matplotlib
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.,...
Open Graph 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 cha...
X 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 cha...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29806
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Feature Request] Proper Arabic Language Support in Matplotlib Plots","articleBody":"## Description\n\nCurrently, when using Arabic text in Matplotlib plots (titles, labels, legends), the text appears incorrectly due to:\n\n1. **Left-to-right rendering** instead of proper **right-to-left**.\n2. Arabic characters are shown as **disconnected** (e.g., \"ت ش ا ت\" instead of \"تشات\").\n3. Usage of fonts that **lack Arabic support**, resulting in broken symbols or empty boxes.\n\nThis greatly affects the usability of Matplotlib for Arabic-speaking users in scientific, academic, and educational contexts.\n\n---\n\n## Proposed Solution\n\nTo resolve this issue, we propose the following enhancements:\n\n1. **Integrate Arabic reshaping and bidi support**:\n - Use [`arabic_reshaper`](https://pypi.org/project/arabic-reshaper/) to properly shape Arabic characters.\n - Use [`python-bidi`](https://pypi.org/project/python-bidi/) to ensure correct text direction.\n\n2. **Support Arabic-compatible fonts** such as:\n - Amiri\n - Noto Naskh Arabic\n - Lateef\n - Cairo\n\n3. **Auto-detect Arabic text** and apply shaping + direction correction internally (if feasible).\n\n---\n\n## Visual Example\n\nThe following image shows a real example of the issue where Arabic text is rendered incorrectly in a plot:\n\n(please see attached image or PDF)\n\n---\n\n## Attached PDF Report\n\nA full report is attached with:\n- Bilingual description (Arabic + English)\n- Proposed technical solution\n- Plot illustration of the current rendering issue\n\n---\n\n## Environment\n\n- Matplotlib version: [please fill]\n- Python version: [please fill]\n- OS: [please fill]\n\nThank you for your efforts and for supporting internationalization!","author":{"url":"https://github.com/ahmadmarzok","@type":"Person","name":"ahmadmarzok"},"datePublished":"2025-03-25T21:44:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/29806/matplotlib/issues/29806"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:27250834-5d99-7a70-a02c-a9c23f91b366 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 849A:371808:1C3D75:25DA5D:6A5174AF |
| html-safe-nonce | 812d249af5fa34ddedb3bc6f8311506b7cb85916799ed93f6b21fb4969f671f5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDlBOjM3MTgwODoxQzNENzU6MjVEQTVEOjZBNTE3NEFGIiwidmlzaXRvcl9pZCI6IjM2ODg2NzgwMDYxOTk1MTQyODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b6384a2008612fa863efb56bc3175362e6529b1e573b2650e7d9253413961da8 |
| hovercard-subject-tag | issue:2947836012 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/29806/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6ec87f487c01ad814e30f45e3723dada67f8cb59366f350368ecb8418dfd7557/matplotlib/matplotlib/issues/29806 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6ec87f487c01ad814e30f45e3723dada67f8cb59366f350368ecb8418dfd7557/matplotlib/matplotlib/issues/29806 |
| og:image:alt | 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 cha... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ahmadmarzok |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b19955a9dd40fd99462443f7911b522d7216776a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width