High-quality visualization is an essential component of data analysis in Bengali, including social media monitoring, educational dashboards, and research plots. However, the widely used Matplotlib library lacks OpenType shaping support, resulting in incorrect rendering of Bengali text; dependent vowels, reph, and conjunct consonants are often displayed in an incorrect sequence or remain uncomposed. As a result, plot titles, axis labels, and heatmap annotations in Bengali are often unreadable, forcing practitioners to rely on manual image editing or non-Unicode font hacks. This paper introduces bangla-render , an open-source Python library for correct Bengali text rendering in Matplotlib and Seaborn using Qt’s HarfBuzz-based text layout engine. Our approach renders Unicode Bengali strings to a QImage , converts them to an RGBA NumPy array, and inserts them as high-resolution raster images through Matplotlib’s AnnotationBbox . The library exposes a high-level API for Bengali titles, axis labels, tick labels, annotations, and heatmap cell text, together with an event-driven layout engine that automatically reduces label overlap across single- and multi-subplot figures. An LRU render cache reduces repeated-label latency by approximately 4 × . We demonstrate the library on standard 2D plots, Seaborn heatmaps, and confusion matrices for Bengali text classification tasks, and verify correct operation on hosted notebook environments including Kaggle and Google Colab. In a 20-string correctness evaluation covering dependent vowels, reph forms, conjunct consonants, and multi-conjunct clusters, default Matplotlib rendered 1/20 strings correctly, whereas bangla-render rendered 20/20 correctly in the tested environment. The rendering pipeline is language-agnostic and has also been verified for Hindi (Devanagari) and Tamil. The software is cross-platform, pip-installable, and aims to fill a long-standing gap in the Python scientific ecosystem for Bengali users.
Mrinal Basak Shuvo (Thu,) studied this question.