-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfig_tab_temp.tex
118 lines (108 loc) · 3.5 KB
/
fig_tab_temp.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
%画像挿入
%%%%%%%%%%%%%%%%%%%%
\begin{figure}
\centering
\includegraphics[width=0.5\linewidth]{fig/title.pdf}
\caption[title]{title}
\label{label}
\end{figure}
%%%%%%%%%%%%%%%%%%%%
%subfigureで画像挿入
%%%%%%%%%%%%%%%%%%%%
\begin{figure}
\centering
\subfigure[]{%
\includegraphics[width=.4\textwidth,clip]{fig/title_1.pdf}%
\label{title_1_1}%
}%
\subfigure[]{%
\includegraphics[width=.4\textwidth,clip]{fig/title_2.pdf}%
\label{title_1_2}%
}
\caption[title]{title。(a)hogehoge、(b)hogehoge。}
\label{title_1}
\end{figure}
%%%%%%%%%%%%%%%%%%%%
%table環境を使う
%%%%%%%%%%%%%%%%%%%%
\begin{table}
\centering
\caption{title}
\footnotesize
\label{label}
\begin{tabular}{cccc}
\hline
\shortstack{hoge} &
\shortstack{hoge} &
\shortstack{hoge} &
\shortstack{hoge}
\\
\hline
hoge & hoge & hoge & hoge\\
\hline
\end{tabular}
\normalsize
\end{table}
%%%%%%%%%%%%%%%%%%%%
%コードの挿入
%%%%%%%%%%%%%%%%%%%%
\begin{lstlisting}[caption = hogehoge,label = code_1_1_1]
import numpy as np
import matplotlib.pyplot as plt
from astropy import constants as asc
plt.rcParams['font.family'] = 'Times New Roman'
plt.rcParams['mathtext.fontset'] = 'stix'
plt.rcParams["font.size"] = 25
plt.rcParams['xtick.direction'] = 'in'
plt.rcParams['ytick.direction'] = 'in'
plt.rcParams['axes.grid'] = True
plt.rcParams['grid.color'] = 'gray'
plt.rcParams['grid.alpha'] = 0.5
plt.rcParams['grid.linestyle'] = 'dashed'
plt.rcParams['axes.grid.axis'] = 'both'
plt.rcParams['axes.grid.which'] = 'major'
plt.rcParams['ytick.minor.visible'] = 'True'
plt.rcParams['ytick.left'] = 'True'
plt.rcParams['ytick.right'] = 'True'
plt.rcParams['xtick.minor.visible'] = 'True'
plt.rcParams['xtick.bottom'] = 'True'
plt.rcParams['xtick.top'] = 'True'
plt.rcParams['axes.linewidth'] = 1.5
plt.rcParams["legend.handlelength"] = 1.0
plt.rcParams["legend.markerscale"] = 1.0
plt.rcParams["legend.fancybox"] = False # 丸角
plt.rcParams["legend.framealpha"] = 1 # 透明度の指定、0で塗りつぶしなし
plt.rcParams["figure.subplot.left"] = 0.14 # 余白
plt.rcParams["figure.subplot.bottom"] = 0.14# 余白
plt.rcParams["figure.subplot.right"] =0.90 # 余白
plt.rcParams["figure.subplot.top"] = 0.91 # 余白
plt.rcParams["figure.subplot.wspace"] = 0.20# 図が複数枚ある時の左右との余白
plt.rcParams["figure.subplot.hspace"] = 0.20# 図が複数枚ある時の上下との余白
plt.rcParams['savefig.dpi'] = 500
plt.rcParams['savefig.bbox'] = 'tight'
plt.rcParams['savefig.pad_inches'] = 0.05
e = np.arange(1.0, 10**(5.0), 1.0) # energy [keV]
m = asc.m_e.cgs*(asc.c.cgs)**2.0 # electron mass [MeV]
x = e/m.to('keV').value
s = 3.0/4.0*( (1.0+x)*x**(-3.0)*( 2.0*x*(1.0+x)*(1.0+2.0*x)**(-1) \
- np.log(1.0+2.0*x) ) + np.log(1.0 + 2.0*x)/(2.0*x) - (1.0+3.0*x)*(1.0+2.0*x)**(-2.0) )
f1 = 1.0 - 2.0*x + 26.0/5.0*x**(2.0)
f2 = 3.0/(8.0*x) * ( np.log(2.0*x) + 0.5 )
plt.figure(figsize=(12,8))
plt.title('The cross-section for Compton scattering',fontsize=25)
plt.xlabel('$\mathrm{E}_{\mathrm{\gamma}}\,[\mathrm{keV}]$')
plt.ylabel('$\mathrm{\\sigma}_{\mathrm{KN}}/\mathrm{\\sigma}_{\mathrm{T}}$')
plt.plot(e, s, lw=2.0, label='Cross section')
plt.plot(e, f1, lw=2.0, ls='dashed', label='Approximate: $x \ll 1$')
plt.plot(e, f2, lw=2.0, ls='dotted', label='Approximate: $x \gg 1$')
plt.xscale('log')
plt.ylim(0.0,1.0)
plt.xlim(1.0,10**(5.0))
plt.legend(loc='upper right')
plt.savefig('fig_compton_sc.pdf')
plt.savefig('fig_compton_sc.png')
plt.savefig('fig_compton_sc.jpg')
plt.show()
plt.close('all')
\end{lstlisting}
%%%%%%%%%%%%%%%%%%%%