From b58aadc7155e48d24e125809206323669c31fc18 Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Sun, 10 Jan 2021 20:17:01 +0800 Subject: [PATCH] update ex2 --- data/ex2.eps | 2 +- src/plot_grid.cpp | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/data/ex2.eps b/data/ex2.eps index 66c3bf5..566dc08 100644 --- a/data/ex2.eps +++ b/data/ex2.eps @@ -5,7 +5,7 @@ %%Creator: GMT6 %%For: unknown %%DocumentNeededResources: font Helvetica Times-Roman -%%CreationDate: Sun Jan 10 14:45:17 2021 +%%CreationDate: Sun Jan 10 20:16:37 2021 %%LanguageLevel: 2 %%DocumentData: Clean7Bit %%Orientation: Portrait diff --git a/src/plot_grid.cpp b/src/plot_grid.cpp index 5163cc0..7684298 100644 --- a/src/plot_grid.cpp +++ b/src/plot_grid.cpp @@ -40,23 +40,20 @@ MAP_ANNOT_OFFSET_PRIMARY=2.5p"; // prepare cpt file std::string args_cpt = grid_name_str + " -Crainbow -R0/1000/0/1000 -Z -D ->" + cpt_file; - // call grd2cpt - GMT_Call_Module (API, "grd2cpt", GMT_MODULE_CMD, (char*) args_cpt.c_str()); - // plot the image std::string args_image = grid_name_str + " -R0/1000/0/1000 -C" + cpt_file + " -Bxag+l\"x (m)\" -Byag+l\"y (m)\" -JX1.5i/1.5i -X1.5i -Y1.5i -K -P --MAP_FRAME_AXES=WesNZ ->" + ps_file; - // call grdimage - GMT_Call_Module (API, "grdimage", GMT_MODULE_CMD, (char*) args_image.c_str()); - // plot color bar - std::string args_bar = "-Dx0.1i/-0.2i+w1.3i/0.05i+h -C" + cpt_file + - " -Bxa -By+lm -O -)" + ps_file; - // call psscale - GMT_Call_Module (API, "psscale", GMT_MODULE_CMD, (char*) args_bar.c_str()); - + std::string args_bar = "-Dx0.1i/-0.2i+w1.3i/0.05i+h -C" + cpt_file + " -Bxa -By+lm -O -)" + ps_file; // convert ps file to raster formats std::string args_pic = ps_file + " -A -TEG -E300"; + + // call grd2cpt + GMT_Call_Module (API, "grd2cpt", GMT_MODULE_CMD, (char*) args_cpt.c_str()); + // call grdimage + GMT_Call_Module (API, "grdimage", GMT_MODULE_CMD, (char*) args_image.c_str()); + // call psscale + GMT_Call_Module (API, "psscale", GMT_MODULE_CMD, (char*) args_bar.c_str()); // call psconvert GMT_Call_Module (API, "psconvert", GMT_MODULE_CMD, (char*) args_pic.c_str());