matplotlib selecting wrong font style/weight
<p>I want to change the default font used in matplotlib plots to be Segoe UI under Windows. I can do so by altering <code>rcParams</code> like so</p>

<pre><code>import matplotlib
matplotlib.rcParams['font.family'] = 'sans-serif'
matplotlib.rcParams['font.sans-serif'] = ['Segoe UI'] + matplotlib.rcParams['font.sans-serif']
matplotlib.rcParams['font.weight'] = 'normal'
</code></pre>

<p>This works, however the weight of the font appears to be wrong. Using the following code I can confirm that matplotlib is picking up the 'Semibold' version of the font rather than the 'Regular' variant that I would expect from setting <code>matplotlib.rcParams['font.weight'] = 'normal'</code>.</p>

<pre><code>from matplotlib.font_manager import findfont, FontProperties
font = findfont(FontProperties(family=['sans-serif']))
print font

&gt;&gt;&gt; c:\windows\fonts\seguisb.ttf
</code></pre>

<p>How can I force matplotlib to use the 'Regular' variant? Is this possible with <code>rcParams</code>?</p>

<p>It seems that matplotlib selects out of all the "Segoe UI" fonts the bold one for no reason. I fear that you cannot do much about this on the rcParams level.</p>

<p>If someone finds a solution to this issue I'd really appreciate it as well. </p>

<p>Until then, here is a workaround using the <code>fontproperties</code> kwarg.</p>

<pre><code>import matplotlib.pyplot as plt
import matplotlib.font_manager as font_manager

fig, ax = plt.subplots()
path = r'C:\Windows\Fonts\segoeui.ttf'
path1 = r'C:\Windows\Fonts\seguisb.ttf'
path2 = r'C:\Windows\Fonts\arial.ttf'
for i, p in enumerate([path,path1,path2]):
    prop = font_manager.FontProperties(fname=p)
    tx = 'Text in {font},\n{path}\nweight {weight}\nvariant {var}'
    tx = tx.format(font=prop.get_name(), weight=prop.get_weight(), var=prop.get_variant(), path=p)
    ax.text(0.1,0.1+i*0.3,tx, fontproperties=prop, size=18)
plt.show()
</code></pre>

<p>The disadvantage clearly is that you need to manually put it everywhere, instead of putting it once in the header.</p>

python matplotlib fonts