<p dir="auto"><strong>Bug summary</strong></p>
<ul dir="auto">
<li>When switching the axes scaling to 'log' the ticklabel font changes to a different font.</li>
</ul>
<p dir="auto"><strong>Code for reproduction</strong></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="logscale = True 
    
# create test data
nPoints = 200
xValues = np.logspace(-14, -4, nPoints)
yValues = [x / (1.0e-9 + x) for x in xValues]

# set up figure
f, ax1 = plt.subplots(1)

# plot data       
ax1.plot(xValues, yValues)

# set range and scale
ax1.set_xlim(1.0e-14, 1.0e-4)
if (logscale):
    ax1.set_xscale('log')
ax1.set_ylim(-0.03, 1.03)

# save to file using pdf backend
f.savefig('minimal.pdf')"><pre class="notranslate"><span class="pl-s1">logscale</span> <span class="pl-c1">=</span> <span class="pl-c1">True</span> 
    
<span class="pl-c"># create test data</span>
<span class="pl-s1">nPoints</span> <span class="pl-c1">=</span> <span class="pl-c1">200</span>
<span class="pl-s1">xValues</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">logspace</span>(<span class="pl-c1">-</span><span class="pl-c1">14</span>, <span class="pl-c1">-</span><span class="pl-c1">4</span>, <span class="pl-s1">nPoints</span>)
<span class="pl-s1">yValues</span> <span class="pl-c1">=</span> [<span class="pl-s1">x</span> <span class="pl-c1">/</span> (<span class="pl-c1">1.0e-9</span> <span class="pl-c1">+</span> <span class="pl-s1">x</span>) <span class="pl-k">for</span> <span class="pl-s1">x</span> <span class="pl-c1">in</span> <span class="pl-s1">xValues</span>]

<span class="pl-c"># set up figure</span>
<span class="pl-s1">f</span>, <span class="pl-s1">ax1</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">subplots</span>(<span class="pl-c1">1</span>)

<span class="pl-c"># plot data       </span>
<span class="pl-s1">ax1</span>.<span class="pl-en">plot</span>(<span class="pl-s1">xValues</span>, <span class="pl-s1">yValues</span>)

<span class="pl-c"># set range and scale</span>
<span class="pl-s1">ax1</span>.<span class="pl-en">set_xlim</span>(<span class="pl-c1">1.0e-14</span>, <span class="pl-c1">1.0e-4</span>)
<span class="pl-k">if</span> (<span class="pl-s1">logscale</span>):
    <span class="pl-s1">ax1</span>.<span class="pl-en">set_xscale</span>(<span class="pl-s">'log'</span>)
<span class="pl-s1">ax1</span>.<span class="pl-en">set_ylim</span>(<span class="pl-c1">-</span><span class="pl-c1">0.03</span>, <span class="pl-c1">1.03</span>)

<span class="pl-c"># save to file using pdf backend</span>
<span class="pl-s1">f</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'minimal.pdf'</span>)</pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>
<p dir="auto"><a href="https://github.com/matplotlib/matplotlib/files/819448/minimal.pdf">minimal.pdf</a></p>
<p dir="auto"><strong>Matplotlib version</strong></p>
<p dir="auto">This used to work for me in matplotlib version 1.5.1<br>
I am currently using mpl version 2.0.0 on OSX 10.11.6.<br>
My python version is 2.7.13<br>
I am using homebrew provided python and installed matplotlib with pip.</p>
<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">Setting the font family through <code class="notranslate">rcParams</code> doesn't impact tick labels if the axis is log-scaled. The size of the font can be changed, but not the family (e.g. using the serif font).</p>
<p dir="auto"><strong>Code for reproduction</strong></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt
from matplotlib import rcParams

rcParams['font.family'] = 'serif'
rcParams['font.size'] = 16

x = [0, 1, 2]
y = [1, 100, 10000]

plt.plot(x, y)
plt.yscale('log')
plt.savefig('logscaled.png')
plt.clf()

plt.plot(x, y)
plt.savefig('not-logscaled.png')"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>
<span class="pl-k">from</span> <span class="pl-s1">matplotlib</span> <span class="pl-k">import</span> <span class="pl-s1">rcParams</span>

<span class="pl-s1">rcParams</span>[<span class="pl-s">'font.family'</span>] <span class="pl-c1">=</span> <span class="pl-s">'serif'</span>
<span class="pl-s1">rcParams</span>[<span class="pl-s">'font.size'</span>] <span class="pl-c1">=</span> <span class="pl-c1">16</span>

<span class="pl-s1">x</span> <span class="pl-c1">=</span> [<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>]
<span class="pl-s1">y</span> <span class="pl-c1">=</span> [<span class="pl-c1">1</span>, <span class="pl-c1">100</span>, <span class="pl-c1">10000</span>]

<span class="pl-s1">plt</span>.<span class="pl-en">plot</span>(<span class="pl-s1">x</span>, <span class="pl-s1">y</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">yscale</span>(<span class="pl-s">'log'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'logscaled.png'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">clf</span>()

<span class="pl-s1">plt</span>.<span class="pl-en">plot</span>(<span class="pl-s1">x</span>, <span class="pl-s1">y</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'not-logscaled.png'</span>)</pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>
<p dir="auto">As seen in this screenshot, the linear-scaled y-axis on the left has a serif font while the log-scaled y-axis on the right still has the default sans-serif font. In both cases the font size is set appropriately to 16. It's just the font family that doesn't change. (Pardon the 'shadow' between the two images, that's my Mac, not matplotlib).</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/15069804/22612861/b6e4ed96-ea30-11e6-8df6-4c192ca0de51.png"><img src="https://cloud.githubusercontent.com/assets/15069804/22612861/b6e4ed96-ea30-11e6-8df6-4c192ca0de51.png" alt="issue" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Expected outcome</strong></p>
<p dir="auto">The code should produce tick labels on log-scaled axes with the specified font family.</p>
<p dir="auto"><strong>Matplotlib version</strong></p>
<ul dir="auto">
<li>Mac OS X 10.10.5</li>
<li>python 3.5, installed from a <a href="https://www.python.org/downloads/mac-osx/" rel="nofollow">Mac installer pkg</a></li>
<li>matplotlib 2.0.0 - upgraded February 3 with <code class="notranslate">python3 -m pip install --upgrade matplotlib</code></li>
</ul>