title: matplotlib - plot outputs text as paths and cannot be converted to LaTeX by Inkscape
body: <p>I have a <code>matplotlib</code> plot that I would like to save in a vector graphics format to then use in a LaTeX document.</p>
  
  <p>I normally save it from <code>matplotlib</code>, open it with Inkscape and save it as PDF+LaTeX (omit text in PDF and create LaTeX file). 
  This can also be achieved with:</p>
  
  <pre><code>inkscape  -D -z --file=in.pdf --export-pdf=out.pdf --export-latex
  </code></pre>
  
  <p>However, for the following plot, the text is actually a series of paths. Each letter is separate, resulting in Inkscape not being able to save a different <code>tex</code> file.</p>
  
  <p>Why is the text not rendered as text but as paths in the code below? Note that the use of <code>usetex=True</code> does not make a difference.</p>
  
  <p>Thanks.</p>
  
  <pre><code>from scipy.stats import lognorm
  from matplotlib import rc
  
  #rc('text', usetex=True)
  rc('font', family='Times New Roman')
  rc('font', size='20.0')
  
  mu    = 1.7
  sigma = 1.1
  n, bins, patches = plt.hist(data, bins=10000, facecolor='k', edgecolor='k', 
                              normed=True, alpha=0.3, histtype='stepfilled',
                              label='\\noindent Empirical data')
  y = lognorm.pdf( bins, sigma, scale=np.exp(mu))
  plt.xlim( (0,50) )
  plt.plot(bins, y, '-', color='k', linewidth=2, label='\\noindent Lognormal curve')
  plt.ylim( (0, .15) )
  plt.xlabel('my x label')
  plt.ylabel('my y label')
  
  plt.grid()
  plt.legend()
  plt.savefig(os.path.expanduser('~/myfile.svg'))
  </code></pre>