GMT的直方图模块histogram
还是很好用的,配合子图模块subplot
可以绘制出很漂亮的直方图。
gmt begin Histogram png,pdf E800
gmt gmtset FONT_ANNOT_PRIMARY 7p,4
gmt gmtset FONT_LABEL 8p,4
gmt gmtset FONT_TAG 8p,4
gmt gmtset MAP_LABEL_OFFSET 3p
gmt gmtset MAP_FRAME_PEN 0.5p
gmt gmtset MAP_ANNOT_OFFSET_PRIMARY 1p
gmt gmtset MAP_TICK_LENGTH_PRIMARY 2p
gmt gmtset MAP_TICK_LENGTH_SECONDARY 1p
gmt subplot begin 3x2 -Ff16c/20c -A -M0.2c/0.5c/0.2c/0.5c
gmt subplot set 0,0
gmt histogram $data1 -R1600/3000/0/130 -T25 -JX? -Bxa200f50+l"Ma" -Bya20f10+l"Counts" -BWStr+glightblue -Gorange -W0.5p
gmt subplot set 0,1
gmt histogram $data2 -R1600/3000/0/60 -T25 -JX? -Bxa200f50+l"Ma" -Bya20f10+l"Counts" -BWStr+glightblue -Gorange -W0.5p
gmt subplot set 1,0
gmt histogram $data3 -R1700/3000/0/60 -T25 -JX? -Bxa200f50+l"Ma" -Bya20f10+l"Counts" -BWStr+glightblue -Gorange -W0.5p
gmt subplot set 1,1
gmt histogram $data4 -R1800/2100/0/180 -T25 -JX? -Bxa50f25+l"Ma" -Bya20f10+l"Counts" -BWStr+glightblue -Gorange -W0.5p
gmt subplot set 2,0
gmt histogram $data5 -R1650/2100/0/150 -T25 -JX? -Bxa50f25+l"Ma" -Bya20f10+l"Counts" -BWStr+glightblue -Gorange -W0.5p
gmt subplot set 2,1
gmt histogram $data6 -R1750/2050/0/150 -T25 -JX? -Bxa50f25+l"Ma" -Bya20f10+l"Counts" -BWStr+glightblue -Gorange -W0.5p
gmt subplot end
gmt end