title: Python figure problem when setting "matplotlib.rcParams['text.usetex'] = True" to use LaTeX in labels AND using the German locale to use the comma
body: <p>I want to create figures in which the x and y tick labels show their numerical values properly formatted for the German language, i.e., using the comma as the decimal separator. I also want to LaTeX elements e.g. in the x or y axis label or the plot legend. The following code shows that the first figure is created as desired for the English language version.</p>
  
  <pre><code># -*- coding: utf-8 -*-
  import numpy as np
  import matplotlib
  import matplotlib.pyplot as plt
  
  import locale
  
  #  Set to German locale to get comma decimal separater
  locale.setlocale(locale.LC_NUMERIC, "deu_deu")
  
  # Use LaTeX elements
  matplotlib.rcParams['text.usetex'] = True
  
  t = np.linspace(0.0, 1.0, 100)
  s = t*np.cos(4 * np.pi * t) + 2
  
  fig, ax = plt.subplots(figsize=(6, 4))
  ax.plot(t, s)
  
  ax.set_xlabel(r'Time $t$ with $t \le 1$')
  ax.set_ylabel('Velocity $v(t)$')
  
  plt.show()
  
  fig.savefig("Mein_Test1.pdf")
  
  
  fig2, ax2 = plt.subplots(figsize=(6, 4))
  ax2.plot(t, s)
  
  ax2.set_xlabel(r'Time $t$ with $t \le 1$')
  ax2.set_ylabel('Velocity $v(t)$')
  
  plt.ticklabel_format(useLocale=True)
  
  plt.show()
  
  fig2.savefig("Mein_Test2.pdf")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/H3jbI.jpg" rel="nofollow noreferrer">The first figure looks as desired, with nice English points as decimal separators and nice spacing in the axis tick labels, and I can use the LaTeX "\le" symbol in the x axix label:
  </a></p>
  
  <p><a href="https://i.stack.imgur.com/8QEvA.jpg" rel="nofollow noreferrer">However, the second figure shows an ugly spacing in the numbers of axis tick labels, with too much space behind the decimal separator:</a></p>
  
  <p>If I do <em>not</em> use "matplotlib.rcParams['text.usetex'] = True", then I cannot have the LaTeX elements in the label, i.e., no "\le" symbol, but then the spacing is correct even for the German commas. So there seems to be some conflict here between the German locale and the "text.usetex". Any ideas to get both right? Thanks!</p>