首页 > 解决方案 > 如何在 Inkscape 中将 Matplotlib Latex 作为带有 Tex 字体的文本导入?

问题描述

我基本上想做和这里一样的事情,但要使用乳胶。有没有办法强制 Inkspace 在作为文本时识别 Tex 字体/文本?

matplotlib - 绘图输出文本为路径,不能被 Inkscape 转换为 LaTeX

但是,有 latex = True

from scipy.stats import lognorm
from matplotlib import rc
import matplotlib.pyplot as plt
import numpy as np
import os
import matplotlib
matplotlib.rcParams['svg.fonttype'] = 'none'
rc('text', usetex=True)
rc('font', family='Times New Roman')
rc('font', size='20.0')

mu    = 1.7
sigma = 1.1
data = np.arange(0,100)

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'))

我想将此作为文本导入 Inkspace。可能吗?

标签: pythonmatplotliblatexinkscape

解决方案


推荐阅读