-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrawing-with-line.gp
executable file
·109 lines (84 loc) · 2.94 KB
/
drawing-with-line.gp
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
#!/usr/bin/env gnuplot
# Author: rachpt
# Date: 2019-05-15
##文件夹名
##-------------------------------------##
foldername=system("basename `pwd`")
##------------select-theta--------------#
#system sprintf("rm -f %s_tsurff_polar.dat", foldername)
### print only the lines for theta=pi/2 and blank lines between the data blocks
#system "awk '$3==1.5707963267948966 || $0==\"\" {print $0}' $(ls -v tsurff-polar*) > tsurff-polar.dat"
### erase superfluous blank lines
#system "cat -s tsurff-polar.dat > temp"
### copy line for phi=0 to the end of a data block
#system sprintf("awk '$4==0 { line=$0 }; $0==\"\" { $0 = $0 line \"\\n\" }; { print $0 }' temp > %s_tsurff_polar.dat", foldername)
#system "rm -f temp"
##------------select-theta--------------#
reset # 重置
set encoding utf8
set term png enhanced size 1400,800 background rgb "white" # font "Noto Sans CJK SC"
# 图片输出路径
set output foldername."_polar_spectrum.png"
set grid # 显示网格
# 设置标题
set label foldername at -3.8,6.2 font ',22'
# 设置 color bar
set palette defined ( 0 0 0 0, 0.1667 0 0 1, 0.5 1 1 0, 1 1 0 0 )
# Heaviside function
theta(x)=(x<0)?0.0:1.0
##-------------------------------------##
set multiplot layout 1,2 # 画多个图片
# 170 --> x
# 171 --> y
set xlabel 'energy {/CMU10 \170}-direction (eV)' font ',18'
set ylabel 'energy {/CMU10 \171}-direction (eV)' font ',18'
set tics nomirror # 不显示坐标对称刻度
set mapping cylindrical # 柱对称坐标系
set pm3d map # 投影到底面
#------位置一-------#
set origin 0.0,0.25
set size 0.6,0.6
set size square # 矩形
#------边界-------#
set tmargin at screen 0.95
set bmargin at screen 0.05
set lmargin at screen 0.05
set rmargin at screen 0.5
#------范围-------#
set xrange [-10:10] #########----!!!
set yrange [-10:10] #########----!!!
# 最大能量值,需要修改
mx=0.5 * 27.2114 #########----!!!
set border 1+2+4
unset key
# gnuplot expects: theta, z, r
splot sprintf("%s_tsurff_polar.dat", foldername) u 4:($5)*(theta(mx-$2)):($1 * 27.2114) w pm3d t foldername
##-------------------------------------##
set mapping cartesian # 笛卡尔坐标系
#------范围-------#
set xrange [2:7] #########----!!!
set yrange [0:6.283185307]
set view 0,0 # 俯视图
set ylabel 'phi' offset -3,1 rotate by 18
set xlabel 'energy' offset 1,2.5
unset key
#------边界-------#
set tmargin at screen 0.95
set bmargin at screen 0.1
set lmargin at screen 0.6
set rmargin at screen 0.95
unset colorbox # 不显示 colorbar
# 拟合直线
nc=6
autime=386
const=1.5
slope=nc*6.582119514/(0.2418884254 * autime)
xd=2.4
# 线1
set arrow 1 from 0+xd,0-const,0 to xd+8*slope,8-const,0 nohead lc 'white' lw 2 front
# 线2
const2=const+2*pi/nc
set arrow 2 from 0+xd,0-const2,0 to xd+8*slope,8-const2,0 nohead lc 'white' lw 2 front
splot sprintf("%s_tsurff_polar.dat", foldername) u ($1*27.2114):4:5 w pm3d
##-------------------------------------##
unset multiplot