how to set up a custom font with custom path to matplotlib global font?
<p>There is a <strong>custom font</strong> in my app</p>

<pre><code>app_path='/home/user1/myapp'
fname='/home/user1/myapp/font/myfont.ttf'
</code></pre>

<p>To setup <strong>globlal</strong> font to matplotlib,the docs said like this:</p>

<pre><code>plt.rcParams['font.sans-serif']=['xxx font']
</code></pre>

<p>But it only works when the font already in system font path,and I have to use <strong>my custom font in my app path</strong> '/home/user1/myapp/font/myfont.ttf'</p>

<p>I know there is a way like this:</p>

<pre><code>fname='/home/user1/myapp/font/myfont.ttf'
myfont=fm.FontProperties(fname=fname)
ax1.set_title('title test',fontproperties=myfont)
</code></pre>

<p>But that is not what I want,I don't want to set '<strong>fontproperties</strong>' all the time,because there are some much code to change</p>