#设置x轴坐标小数位数
set format y “%.1f” # 设置y轴刻度格式为小数点后1位
set format x “%.0f” # 设置x轴刻度格式为小数点后0位
# 设置x,y刻度
set xtics font “Times-Roman,14”
set ytics (-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3) font “Times-Roman,14”
#设置坐标范围
set yrange [-2.5:3]
#设置坐标标题及样式
set xlabel “X Axis” font “Times-Roman,14”
set ylabel “Y Axis” font “Times-Roman,14”
#设置背景网格
set grid ytics lw 2 ls 14
#设置坐标轴线的宽度和样式
set style line 3 lt 1 lw 1.5 lc rgb “#222222”#黑色,线宽2
set border 4095 back ls 3 #使用上面定义的样式
#设置样例表
set key top left box spacing 1.5 samplen 3
#画出曲线
set style line 1 lc rgb “#FF4400” lt 1 lw 2 # 设置线型1为红色实线,线宽为2
set style line 2 lc rgb “#0044FF” lt 2 lw 2 # 设置线型2为蓝色虚线,线宽为3
plot ‘C:\Users\NINGMEI\Desktop\gunplotlearn\data.txt’ using 1:2 with lines title ‘ Cd’ linestyle 1,\
‘C:\Users\NINGMEI\Desktop\gunplotlearn\data.txt’ using 1:3 with lines title ‘ Cl’ linestyle 2;