2

(i) 我需要显示 3 个重叠带,如果使用三种颜色(具有受控不透明度),这不是很好。(ii) 然后我需要一个乐队的舱口填充_之间。代码如下。(iii) 现在我在以 .ps 或 .eps 导出时面临颜色不透明度的问题。Pdf 输出看起来不错,但是当放在纸上(乳胶;kile)时,它们看起来更暗。无论如何,我只需要 .ps 或 .eps 格式的无花果。可以使用 'pdf2ps' 获得它,但在这种情况下,输出 .ps 文件在论文(乳胶)中看起来非常微弱。请建议一种从中获取 .ps 或 .eps(仅限矢量格式)输出的方法。谢谢。

from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
## for Palatino and other serif fonts use:
#rc('font',**{'family':'serif','serif':['Palatino']})
rc('text', usetex=True)

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle

lcrit=0.5-np.sqrt(5)/6
l,r1,r2,r3,r4,r5,r6,zn2=np.loadtxt("stiff_reso.d",usecols=(0,1,2,3,4,5,6,7),unpack=True)

plt.plot(l,r1,linewidth=2,color="green")
plt.plot(l,r2,linewidth=2,color="green")
plt.plot(l,r3,linewidth=2,color="black")
plt.plot(l,r4,linewidth=2,color="black")
plt.plot(l,r5,linewidth=2,color="red")
plt.plot(l,r6,linewidth=2,color="red")

plt.fill_between(l,r2,r1, color='green',alpha=0.4)
plt.fill_between(l,r4,r3, color="none",hatch="/",edgecolor="k")
plt.fill_between(l,r6,r5, color='red',alpha=0.4)

plt.plot([lcrit,lcrit], [0,25], color='purple', linestyle='dashed', linewidth=2)

plt.ylabel(r"$(a_-/a_E)$",fontsize=20)
plt.xlabel(r"$\Lambda/(\kappa \rho_c)$",fontsize=20)

ax= plt.gca()

plt.xlim([0,0.14])
plt.ylim([1,5.5])
plt.text(0.122, 2.0, r'$\Lambda=\Lambda_{crit}$',rotation='vertical', fontsize=16)

p1 = Rectangle((0, 0), 1, 1, fc="green",alpha=0.4)
p2 = Rectangle((0, 0), 1, 1,hatch="//",edgecolor="k")
p3 = Rectangle((0, 0), 1, 1, fc="red",alpha=0.4)
plt.legend([p1,p2,p3], ["1st resonance band","2nd resonance band","3rd resonance   band"],loc=2)

#plt.savefig("reso_stiff.eps")
plt.savefig("reso_stiff.pdf")
plt.show()
4

0 回答 0