-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhf2s6-bands_dos.gp
More file actions
128 lines (99 loc) · 3.43 KB
/
hf2s6-bands_dos.gp
File metadata and controls
128 lines (99 loc) · 3.43 KB
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
119
120
121
122
123
124
125
126
127
128
set terminal pdfcairo size 10cm,10cm enhanced font 'Times,16'
set output 'Hf2S6.pdf'
########################################################################
# Gnuplot Script: Band Structure and DOS
# Author: Carlos Maciel O. Bastos
# Date: 09/07/2025
# Description: Creates a 2x2 multiplot figure with band structure and DOS
########################################################################
##############################
# 2. Multiplot Layout
##############################
set multiplot layout 2,2 scale 1.0,1.0 # 2x2 grid layout (only two plots used)
##############################
# 3. Global Variables
##############################
# High-symmetry point coordinates for band structure
a = 0.610
b = 1.479
c = 2.089
d = 2.958
#e = 3.231
#f = 4.201
#g = 1.436889
# Fermi level
#ef = -6.474400
ef=0
# Plot range
y1 = -3
y2 = 5
yf = y1
yg = y2
##############################
# 4. General Styles and Arrows
##############################
set style line 1 lc rgb "coral" lt 1 lw 2 pt 7 ps 1.5 # PBE band
set style line 2 lc rgb "black" lt 2 lw 2 pt 5 ps 1.5 # HSE06 band
# Set tics and axis formatting
set ytics format "%.1f"
set xrange [0:d]
set yrange [y1:y2]
# High-symmetry point labels (X, G, etc.)
set xtics ("{/Symbol G}" 0.000, "X" a, "M" b, "Y" c, "{/Symbol G}" d)
# Vertical dashed lines at high-symmetry points
do for [x in "a b c "]{
eval(sprintf("set arrow from %s,%.3f to %s,%.3f nohead lc rgb 'gray' dt 2 lw 2", x, yf, x, yg))
}
# Horizontal line at Fermi level
set arrow from 0,0 to d,0 nohead dt 2 lw 2 lc rgb "gray"
# Annotation (example)
set label "V.B.M." at graph 0.05, graph 0.4 front font ",15" tc rgb "dark-gray"
##############################
# 5. First Plot: Band Structure
##############################
# Position and size for subplot 1
set origin -0.1, 0.0
set size 0.9, 0.99
# Axis labels
set ylabel "Energy (eV)" offset 1
set xlabel ""
set key r c
shift1=0.56
shift2=0.99
shift3=0.85
# Plot bands from data files
plot \
'../data_pbe/Hf2S6/bands_gnuplot.dat' using ($1):($2+shift1) with lines linestyle 1 title 'PBE', \
'../data_hse/Hf2S6/bands_gnuplot.dat' using ($1):($2+shift2) with lines linestyle 2 title "HSE06"
##############################
# 6. Second Plot: Density of States (DOS)
##############################
# Reset arrows, labels, and tics from previous plot
unset arrow
unset label
unset ylabel
unset xtics
unset ytics
unset key
unset object 1
# Position and size for subplot 2
set origin 0.7, 0.012
set size 0.35, 0.978
# Axis settings
set xlabel "DOS"
set xrange [0:7]
set yrange [y1:y2]
# DOS legend settings
set key samplen 2 spacing 1 t at 6,2.5 font "Times,14"
# Plot DOS curves (adjust file paths and styles as needed)
plot \
"../data_hse/Hf2S6/Hf_ldos_gnuplot.dat" using ($2):($1+shift3) with lines lw 2 lc rgb "red" title "Hf-s", \
"../data_hse/Hf2S6/Hf_ldos_gnuplot.dat" using ($3):($1+shift3) with lines lw 2 lc rgb "green" title "Hf-p", \
"../data_hse/Hf2S6/Hf_ldos_gnuplot.dat" using ($4):($1+shift3) with lines lw 2 lc rgb "blue" title "Hf-d", \
"../data_hse/Hf2S6/Hf_ldos_gnuplot.dat" using ($5):($1+shift3) with lines lw 2 lc rgb "magenta" title "Hf-f", \
"../data_hse/Hf2S6/S_ldos_gnuplot.dat" using ($2):($1+shift3) with lines lw 2 lc rgb "orange" title "S-s", \
"../data_hse/Hf2S6/S_ldos_gnuplot.dat" using ($3):($1+shift3) with lines lw 2 lc rgb "coral" title "S-p", \
##############################
# End of Multiplot
##############################
#unset multiplot