title: matplotlib - set font to Times New Roman
body: <p>I want to use Times New Roman font with my matplotlib plots. I'm currently using <code>matplotlib-3.5.1</code> and I have <code>fonttools-4.28.5</code> installed. However, when I try:</p>
  <pre><code>plt.rcParams[&quot;font.family&quot;] = &quot;Times New Roman&quot;
  </code></pre>
  <p>The font doesn't change. I then found a recommendation to instead try:</p>
  <pre><code>plt.rcParams[&quot;font.family&quot;] = &quot;DejaVu Serif&quot;
  plt.rcParams[&quot;font.serif&quot;] = [&quot;Times New Roman&quot;]
  </code></pre>
  <p>This also had no effect. What am I doing wrong and how do I fix it?</p>
  <p>I already looked at other posts e.g. <a href="https://stackoverflow.com/questions/58200929/how-to-make-default-font-type-in-matplotlib-to-times-new-roman">1</a>, <a href="https://stackoverflow.com/questions/40734672/how-to-set-the-label-fonts-as-time-new-roman-by-drawparallels-in-python/40734893">2</a> to no avail.</p>
  <p>Edit: Following <a href="https://stackoverflow.com/a/28382215/4570472">this post</a>, it appears that matplotlib doesn't have Times New Roman?</p>
  <pre><code>['C059', 'C059', 'C059', 'C059', 'D050000L', 'DejaVu LGC Sans Mono', 'DejaVu LGC Sans Mono', 'DejaVu LGC Sans Mono', 'DejaVu LGC Sans Mono', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans Display', 'DejaVu Sans Mono', 'DejaVu Sans Mono', 'DejaVu Sans Mono', 'DejaVu Sans Mono', 'DejaVu Sans Mono', 'DejaVu Sans Mono', 'DejaVu Sans Mono', 'DejaVu Sans Mono', 'DejaVu Serif', 'DejaVu Serif', 'DejaVu Serif', 'DejaVu Serif', 'DejaVu Serif Display', 'Liberation Mono', 'Liberation Mono', 'Liberation Mono', 'Liberation Mono', 'Nimbus Mono PS', 'Nimbus Mono PS', 'Nimbus Mono PS', 'Nimbus Mono PS', 'Nimbus Roman', 'Nimbus Roman', 'Nimbus Roman', 'Nimbus Roman', 'Nimbus Sans', 'Nimbus Sans', 'Nimbus Sans', 'Nimbus Sans', 'Nimbus Sans Narrow', 'Nimbus Sans Narrow', 'Nimbus Sans Narrow', 'Nimbus Sans Narrow', 'P052', 'P052', 'P052', 'P052', 'STIX', 'STIX', 'STIX', 'STIX', 'STIX Math', 'STIXGeneral', 'STIXGeneral', 'STIXGeneral', 'STIXGeneral', 'STIXNonUnicode', 'STIXNonUnicode', 'STIXNonUnicode', 'STIXNonUnicode', 'STIXSizeFiveSym', 'STIXSizeFourSym', 'STIXSizeFourSym', 'STIXSizeOneSym', 'STIXSizeOneSym', 'STIXSizeThreeSym', 'STIXSizeThreeSym', 'STIXSizeTwoSym', 'STIXSizeTwoSym', 'URW Bookman', 'URW Bookman', 'URW Bookman', 'URW Bookman', 'URW Gothic', 'URW Gothic', 'URW Gothic', 'URW Gothic', 'Z003', 'cmb10', 'cmex10', 'cmmi10', 'cmr10', 'cmss10', 'cmsy10', 'cmtt10']
  </code></pre>