python - 如何在 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。可能吗?
解决方案
推荐阅读
- javascript - 如何在不重置组件的情况下更改按钮的表情符号?
- javascript - 用于 Python 2/Ignition 的具有 2 个不同分隔符的 CSV 数据
- javascript - 使用 Javascript React 创建网格
- java - NiFI:-无法为 CONTROLLER_SERVICE org.apache.nifi.record.sink.lookup.RecordSinkServiceLookup 创建扩展定义
- apache-flink - 如何在 PyFlink 中使用 Table API 读取多个目录?
- powerapps - PowerApps-以优化的方式获取组织层次结构
- c++ - 选择某些项目时,MFC如何在组合框中键入
- mysql - MySQL加入分组没有完美加入
- javascript - 如何在我的 src 文件夹中不包含 mocha (TDD) 函数,如“describe”和“it”,而只包含在 test 文件夹中?[TS]
- java - Spring Cloud Gateway:在自定义谓词中设置响应状态码