madanalysisで計算したrelic densityのscan_maddm_[1-209].txtを使ったrelic densityの等高線の図の作成のためのプロット。

# matplotlib example file for a contour plot by K. Mawatari (2017.11.29)
# type 'python plot_contour.py' 

import numpy as np
import matplotlib.pyplot as plt

# import data files
data1 = np.loadtxt('scan_maddm_[1-209].txt', skiprows=1, usecols=(1,2,3)) # 3D data

# define the columns
#x=data1[:,0]
#y=data1[:,1]
x=np.linspace(500, 2500, 21)
y=np.linspace(50, 500, 10)
X,Y=np.meshgrid(x, y)
z=data1[:,2].reshape(21,10)
Z=z.transpose()

cont=plt.contour(X,Y,Z, levels=[1,0.12, 0.01, 0.001])
cont.clabel(fmt='%1.3f', fontsize=14)

# set up the plots
xlab=r'$m_Y$ [GeV]'
ylab=r'$m_X$ [GeV]'
xlimrange=[0,2500]
ylimrange=[0,500]
savepdf='test_contour.pdf'

#plt.yscale('log')
plt.xlim(xlimrange)
plt.ylim(ylimrange)
plt.title("Relic density for simplified DM (s-channel spin-1)")
plt.xlabel(xlab, fontsize=18)
plt.ylabel(ylab, fontsize=18)
#plt.legend()
plt.grid()

### make the plot
plt.savefig(savepdf, format='pdf', bbox_inches='tight')
plt.show()

これでできる図がこちら参考文献のFig.8(left)を再現したかったけどうまくいっていない。MadDMのauthorと原因を究明中。

relic densityの等高線の図の作成 (最終更新日時 2017-11-30 09:12:42 更新者 KanaeAsai)