如何在Inkscape中将Matplotlib Latex作为文本导入到Tex字体中?

2024-10-01 17:41:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我基本上想做和这里一样的事情,但是要用乳胶。是否有一种方法可以强制Inkspace在将Tex字体/文本作为文本时识别Tex字体/文本

matplotlib - plot outputs text as paths and cannot be converted to LaTeX by Inkscape

然而,拥有乳胶=真

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。可能吗


Tags: 文本importdataplotmatplotlibasnp字体

热门问题