[英]matplotlib fails to output EPS figure with usetex = True
I am trying to output ( savefig
) matplotlib figures as EPS; 我试图将(
savefig
)matplotlib数字输出为EPS; however, it seems there is a conflict when using the LaTeX rendering AND saving EPS figures. 但是,使用LaTeX渲染并保存EPS数据时似乎存在冲突。 For example, the following code produces a good EPS figure:
例如,以下代码可产生良好的 EPS值:
import matplotlib.pyplot as plt
import numpy as np
plt.figure()
plt.plot(np.random.rand(100))
plt.savefig('plot.eps')
whereas this code produces an EPS figure that can not be viewed; 而此代码产生的EPS数字无法查看; my document viewer (Ubuntu's Evince) continuously says "Loading..."
我的文档查看器(Ubuntu的Evince)连续说“正在加载...”
import matplotlib.pyplot as plt
import numpy as np
plt.rc('text', usetex = True)
plt.figure()
plt.plot(np.random.rand(100))
plt.savefig('plot.eps')
Is there a known issue when combining these two options? 结合这两个选项时是否存在已知问题? Is there any kind of work around (aside from saving as PDF or saving as PDF then converting to EPS)?
是否有其他解决方法(除了另存为PDF或另存为PDF然后转换为EPS)?
The only solution I could find was to update matplotlib from 1.2.1 to 1.3.1. 我能找到的唯一解决方案是将matplotlib从1.2.1更新到1.3.1。 Now it works without problems.
现在它可以正常工作了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.