fixed a bug for gmtxy-image/2 when range starts by a negative value

This commit is contained in:
张壹 2020-06-08 22:28:15 +08:00
parent b42ec4a550
commit c6ef63f76a
2 changed files with 2 additions and 2 deletions

View File

@ -76,7 +76,7 @@ else
fi fi
#根据横纵坐标的范围计算图片的长和高 我们默认图片宽度为1.5i #根据横纵坐标的范围计算图片的长和高 我们默认图片宽度为1.5i
range_coor=(${range//// }) range_coor=(${range//// })
pic_height=`echo "scale=4; 1.5 * (${range_coor[3]}-${range_coor[2]})/(${range_coor[1]}-${range_coor[0]})"|bc` pic_height=`echo "scale=4; 1.5 * (${range_coor[3]} - ${range_coor[2]})/(${range_coor[1]} - ${range_coor[0]})"|bc`
# 设置绘图参数 # 设置绘图参数
gmt gmtset \ gmt gmtset \
FONT_ANNOT_PRIMARY=10.5p,Times-Roman,black \ FONT_ANNOT_PRIMARY=10.5p,Times-Roman,black \

View File

@ -180,7 +180,7 @@ else
fi fi
#根据横纵坐标的范围计算图片的长和高 我们默认图片宽度为1.5i #根据横纵坐标的范围计算图片的长和高 我们默认图片宽度为1.5i
range_coor=(${range//// }) range_coor=(${range//// })
pic_height=`echo "scale=4; ${layouts[0]%i} * (${range_coor[3]}-${range_coor[2]})/(${range_coor[1]}-${range_coor[0]})"|bc` pic_height=`echo "scale=4; ${layouts[0]%i} * (${range_coor[3]} - ${range_coor[2]})/(${range_coor[1]} - ${range_coor[0]})"|bc`
# 输出一个bash脚本的头部到屏幕 # 输出一个bash脚本的头部到屏幕
if [[ ${run_command} == 0 && ${from_open} == '>' ]]; then if [[ ${run_command} == 0 && ${from_open} == '>' ]]; then