GMT绘制直方图

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
直方图
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容