<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="plt.plot([1,2,3,8,6,4,3,1],'o-',label='राष्ट्र')
plt.xlabel('निवृत्ति प्रतिशत')
plt.ylabel('चक्रीय ब्याज')
plt.legend()"><pre class="notranslate"><code class="notranslate">plt.plot([1,2,3,8,6,4,3,1],'o-',label='राष्ट्र')
plt.xlabel('निवृत्ति प्रतिशत')
plt.ylabel('चक्रीय ब्याज')
plt.legend()
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/10902216/68080742-c8ca2e00-fdd7-11e9-91d3-c1006da1df62.png"><img src="https://user-images.githubusercontent.com/10902216/68080742-c8ca2e00-fdd7-11e9-91d3-c1006da1df62.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Devanagari font rendering is incorrect. For example: निवृत्ती प्रतिशत should be displayed as<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/10902216/68080730-9caead00-fdd7-11e9-95ca-31a280667128.png"><img src="https://user-images.githubusercontent.com/10902216/68080730-9caead00-fdd7-11e9-95ca-31a280667128.png" alt="image" style="max-width: 100%;"></a> but is instead displayed as: <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/10902216/68080736-ba7c1200-fdd7-11e9-86e9-dd13a234e155.png"><img src="https://user-images.githubusercontent.com/10902216/68080736-ba7c1200-fdd7-11e9-86e9-dd13a234e155.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">In matplotlibrc I have specified</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="font.family         : sans-serif
font.sans-serif     : Lohit Devanagari"><pre class="notranslate"><code class="notranslate">font.family         : sans-serif
font.sans-serif     : Lohit Devanagari
</code></pre></div>
<p dir="auto"><a href="https://www.fontsc.com/font/lohit-devanagari" rel="nofollow"><code class="notranslate">Lohit devanagari</code></a> has the required glyphs, in fact the correct rendering example is using <code class="notranslate">Lohit Devanagari</code> font.</p>
<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>

<p dir="auto">Title sums it up all I guess.<br>
Related:</p>
<ul dir="auto">
<li>Issue <a href="https://github.com/matplotlib/matplotlib/issues/3517" data-hovercard-type="issue" data-hovercard-url="/matplotlib/matplotlib/issues/3517/hovercard">#3517</a> on Github</li>
<li><a href="https://stackoverflow.com/questions/10960463/non-ascii-characters-in-matplotlib" rel="nofollow">This</a> and <a href="https://stackoverflow.com/questions/40956636/missing-polish-characters-in-matplotlib-pyplot-labels-regardless-of-using-utf-8?noredirect=1&amp;lq=1" rel="nofollow">this</a> on stack exchange</li>
</ul>
<p dir="auto">Here I used sinhala as <a href="http://unicode.org/faq/indic.html" rel="nofollow">Indic Script</a> instance.<br>
I think the font family has to do something with this issue since output to different font families are different. I'm not an expert in these stuff. Help appreciated to to get this work even with a different font family.<br>
An example is given below for which I've tried with 3 different font families.<br>
<strong>Code for reproduction</strong></p>

<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from matplotlib import rc
families = ['WARNA','LKLUG','Arial']
for familyname in families:
    rc('font', family=familyname)
    from matplotlib import pyplot as plt
    import numpy as np
    r = np.linspace(0.1,5,100)
    A = 3*2/(r*2)+np.pi*r**2
    fig = plt.figure()
    axes = fig.add_axes([.1,.1,.8,.8]) 
    axes.plot(r,A)
    axes.set_ylabel(u'වර්ගඵලය')
    axes.set_xlabel(u'අරය')
    axes.set_title(familyname)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">matplotlib</span> <span class="pl-k">import</span> <span class="pl-s1">rc</span>
<span class="pl-s1">families</span> <span class="pl-c1">=</span> [<span class="pl-s">'WARNA'</span>,<span class="pl-s">'LKLUG'</span>,<span class="pl-s">'Arial'</span>]
<span class="pl-k">for</span> <span class="pl-s1">familyname</span> <span class="pl-c1">in</span> <span class="pl-s1">families</span>:
    <span class="pl-en">rc</span>(<span class="pl-s">'font'</span>, <span class="pl-s1">family</span><span class="pl-c1">=</span><span class="pl-s1">familyname</span>)
    <span class="pl-k">from</span> <span class="pl-s1">matplotlib</span> <span class="pl-k">import</span> <span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>
    <span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
    <span class="pl-s1">r</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">0.1</span>,<span class="pl-c1">5</span>,<span class="pl-c1">100</span>)
    <span class="pl-v">A</span> <span class="pl-c1">=</span> <span class="pl-c1">3</span><span class="pl-c1">*</span><span class="pl-c1">2</span><span class="pl-c1">/</span>(<span class="pl-s1">r</span><span class="pl-c1">*</span><span class="pl-c1">2</span>)<span class="pl-c1">+</span><span class="pl-s1">np</span>.<span class="pl-s1">pi</span><span class="pl-c1">*</span><span class="pl-s1">r</span><span class="pl-c1">**</span><span class="pl-c1">2</span>
    <span class="pl-s1">fig</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">figure</span>()
    <span class="pl-s1">axes</span> <span class="pl-c1">=</span> <span class="pl-s1">fig</span>.<span class="pl-en">add_axes</span>([<span class="pl-c1">.1</span>,<span class="pl-c1">.1</span>,<span class="pl-c1">.8</span>,<span class="pl-c1">.8</span>]) 
    <span class="pl-s1">axes</span>.<span class="pl-en">plot</span>(<span class="pl-s1">r</span>,<span class="pl-v">A</span>)
    <span class="pl-s1">axes</span>.<span class="pl-en">set_ylabel</span>(<span class="pl-s">u'වර්ගඵලය'</span>)
    <span class="pl-s1">axes</span>.<span class="pl-en">set_xlabel</span>(<span class="pl-s">u'අරය'</span>)
    <span class="pl-s1">axes</span>.<span class="pl-en">set_title</span>(<span class="pl-s1">familyname</span>)</pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>

<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/5713d323f515f4277b2596293f4e37abf56a631112b1fb3d433b44dd7099ec67/687474703a2f2f692e696d6775722e636f6d2f4b754864456d6b2e706e67"><img src="https://camo.githubusercontent.com/5713d323f515f4277b2596293f4e37abf56a631112b1fb3d433b44dd7099ec67/687474703a2f2f692e696d6775722e636f6d2f4b754864456d6b2e706e67" alt="Result 1" data-canonical-src="http://i.imgur.com/KuHdEmk.png" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/5898965bc1f3e4f94ce9b1fda309bc139da144e4589eee05ba463d64affaef5d/687474703a2f2f692e696d6775722e636f6d2f33646f7a6d66302e706e67"><img src="https://camo.githubusercontent.com/5898965bc1f3e4f94ce9b1fda309bc139da144e4589eee05ba463d64affaef5d/687474703a2f2f692e696d6775722e636f6d2f33646f7a6d66302e706e67" alt="Result 2" data-canonical-src="http://i.imgur.com/3dozmf0.png" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/b2d033549dc2f5708c5319a904c203c2966f918b91e56e0b2903ad45a718b319/687474703a2f2f692e696d6775722e636f6d2f57573230694e6c2e706e67"><img src="https://camo.githubusercontent.com/b2d033549dc2f5708c5319a904c203c2966f918b91e56e0b2903ad45a718b319/687474703a2f2f692e696d6775722e636f6d2f57573230694e6c2e706e67" alt="Result 3" data-canonical-src="http://i.imgur.com/WW20iNl.png" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Expected outcome</strong></p>


<p dir="auto">Result 1 looks fine but it has 2 problems:</p>
<ul dir="auto">
<li>Accents not been placed in the correct location. ("්" in "වර්ගඵලය" is placed after "ර" not before)</li>
<li>Letter "A" is not renderd in the title "WARNA"</li>
</ul>
<p dir="auto">Issues in result 2:</p>
<ul dir="auto">
<li>Same previous accent issue</li>
<li>Axis values or title not shown at all</li>
</ul>
<p dir="auto">Issues in result 3:</p>
<ul dir="auto">
<li>No Sinhala script shown.</li>
</ul>
<p dir="auto"><strong>Versions</strong></p>
<table role="table">
<thead>
<tr>
<th>Software</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Python</td>
<td>2.7.13 64bit [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]</td>
</tr>
<tr>
<td>IPython</td>
<td>5.1.0</td>
</tr>
<tr>
<td>OS</td>
<td>Linux 4.4.0 78 generic x86_64 with debian jessie sid</td>
</tr>
<tr>
<td>matplotlib</td>
<td>1.5.1</td>
</tr>
</tbody>
</table>
<p dir="auto">(Matplotlib from anaconda bundle)</p>
<p dir="auto">Wed Jun 14 22:54:11 2017 +0530</p>