Files
gromacs_docker/script/S112D/plot_rmsd.sh
2024-10-05 19:08:54 +08:00

34 lines
705 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 检查输入参数数量
if [ "$#" -ne 2 ]; then
echo "Usage: $0 input.xvg output.svg"
exit 1
fi
# 获取输入和输出文件名
input_file=$1
output_file=$2
# 检查输入文件是否存在
if [ ! -f "$input_file" ]; then
echo "Error: Input file '$input_file' not found!"
exit 1
fi
# 使用 Gnuplot 生成输出文件
gnuplot << EOF
set terminal svg size 800,600
set output '${output_file}'
# 设置标题和轴标签
set title 'RMSD Analysis'
set xlabel 'Time (ns)'
set ylabel 'RMSD (nm)'
# 读取数据文件并绘制使用第1列和第2列忽略注释行
plot '${input_file}' using 1:2 with lines title 'RMSD (nm)'
EOF
echo "Plot generated: ${output_file}"