Skip to content

Commit 7941eeb

Browse files
committed
Merge branch 'master' into psconvert-no-file-dup
2 parents 50baea8 + 8e8f8ca commit 7941eeb

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

src/gmt_init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4987,6 +4987,9 @@ GMT_LOCAL int gmtinit_parse5_B_option (struct GMT_CTRL *GMT, char *in) {
49874987
if (GMT->common.J.zactive) GMT->current.map.frame.drawz = true; /* Also brings z-axis into contention */
49884988
GMT->current.setting.map_frame_type = GMT_IS_PLAIN; /* Since checkerboard without intervals look stupid */
49894989
GMT->current.map.frame.set[no] = true; /* Since we want this axis drawn */
4990+
#ifdef B0_IS_NO_FRAME
4991+
GMT->current.map.frame.no_frame = true; /* Understand format '0' to mean "NO FRAME AT ALL" */
4992+
#endif
49904993
continue;
49914994
}
49924995

src/grdconvert.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#define THIS_MODULE_MODERN_NAME "grdconvert"
3030
#define THIS_MODULE_LIB "core"
3131
#define THIS_MODULE_PURPOSE "Convert between different grid formats"
32-
#define THIS_MODULE_KEYS "<G{,>G}"
32+
#define THIS_MODULE_KEYS "<G{,GG}"
3333
#define THIS_MODULE_NEEDS ""
3434
#define THIS_MODULE_OPTIONS "-RVf"
3535

@@ -170,9 +170,11 @@ static int parse (struct GMT_CTRL *GMT, struct GRDCONVERT_CTRL *Ctrl, struct GMT
170170
n_in++;
171171
break;
172172
case '>': /* Output file may be set this way from the external API */
173-
n_errors += gmt_M_repeated_module_option (API, Ctrl->G.active);
174-
n_errors += gmt_get_required_file (GMT, opt->arg, opt->option, 0, GMT_IS_GRID, GMT_OUT, GMT_FILE_LOCAL, &(Ctrl->G.file));
175-
n_in++;
173+
if (!Ctrl->G.active) { /* No output grid yet. This should be used when returning the output grid to Julia/Matlab */
174+
n_errors += gmt_M_repeated_module_option (API, Ctrl->G.active);
175+
n_errors += gmt_get_required_file (GMT, opt->arg, opt->option, 0, GMT_IS_GRID, GMT_OUT, GMT_FILE_LOCAL, &(Ctrl->G.file));
176+
n_in++;
177+
}
176178
break;
177179

178180
/* Processes program-specific parameters */

src/psscale.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,30 +1388,34 @@ GMT_LOCAL void psscale_draw_colorbar (struct GMT_CTRL *GMT, struct PSSCALE_CTRL
13881388

13891389
PSL_setlinecap (PSL, PSL_SQUARE_CAP); /* Square cap required for box of scale bar */
13901390

1391-
if (gap == 0.0) {
1392-
if ((flip & PSSCALE_FLIP_ANNOT) || !B_set) PSL_plotsegment (PSL, xleft, 0.0, xleft + length, 0.0);
1393-
if (!(flip & PSSCALE_FLIP_ANNOT) || !B_set) PSL_plotsegment (PSL, xleft, width, xleft + length, width);
1394-
PSL_plotsegment (PSL, xleft, 0.0, xleft, width);
1395-
PSL_plotsegment (PSL, xright, 0.0, xright, width);
1391+
if (gap == 0.0 && !GMT->current.map.frame.no_frame) {
1392+
if ((flip & PSSCALE_FLIP_ANNOT) || !B_set) PSL_plotsegment(PSL, xleft, 0.0, xleft + length, 0.0);
1393+
if (!(flip & PSSCALE_FLIP_ANNOT) || !B_set) PSL_plotsegment(PSL, xleft, width, xleft + length, width);
1394+
PSL_plotsegment(PSL, xleft, 0.0, xleft, width);
1395+
PSL_plotsegment(PSL, xright, 0.0, xright, width);
13961396
}
13971397

13981398
if (B_set) { /* Used -B */
1399-
gmt_xy_axis2 (GMT, xleft, y_base, length, start_val, stop_val, A, !(flip & PSSCALE_FLIP_ANNOT), GMT->current.map.frame.side[flip & PSSCALE_FLIP_ANNOT ? N_SIDE : S_SIDE] & PSSCALE_FLIP_LABEL, GMT->current.map.frame.side[flip & PSSCALE_FLIP_ANNOT ? N_SIDE : S_SIDE]);
1399+
if (!GMT->current.map.frame.no_frame)
1400+
gmt_xy_axis2(GMT, xleft, y_base, length, start_val, stop_val, A, !(flip & PSSCALE_FLIP_ANNOT),
1401+
GMT->current.map.frame.side[flip & PSSCALE_FLIP_ANNOT ? N_SIDE : S_SIDE] & PSSCALE_FLIP_LABEL,
1402+
GMT->current.map.frame.side[flip & PSSCALE_FLIP_ANNOT ? N_SIDE : S_SIDE]);
1403+
14001404
if (A->item[GMT_GRID_UPPER].active) {
1401-
dx = gmtlib_get_map_interval (GMT, A->type, &A->item[GMT_GRID_UPPER]);
1405+
dx = gmtlib_get_map_interval(GMT, A->type, &A->item[GMT_GRID_UPPER]);
14021406
gmt_setpen (GMT, &GMT->current.setting.map_grid_pen[GMT_PRIMARY]);
14031407
if (A->type == GMT_TIME)
1404-
gmt_plot_timex_grid (GMT, PSL, P->data[0].z_low, P->data[P->n_colors-1].z_high, 0.0, width, GMT_GRID_UPPER);
1408+
gmt_plot_timex_grid(GMT, PSL, P->data[0].z_low, P->data[P->n_colors-1].z_high, 0.0, width, GMT_GRID_UPPER);
14051409
else
1406-
gmt_linearx_grid (GMT, PSL, P->data[0].z_low, P->data[P->n_colors-1].z_high, 0.0, width, dx);
1410+
gmt_linearx_grid(GMT, PSL, P->data[0].z_low, P->data[P->n_colors-1].z_high, 0.0, width, dx);
14071411
}
14081412
}
1409-
else { /* When no -B we annotate every CPT bound which may be non-equidistant, hence this code (i.e., we cannot fake a call to -B) */
1413+
else if (!GMT->current.map.frame.no_frame) { /* When no -B we annotate every CPT bound which may be non-equidistant, hence this code (i.e., we cannot fake a call to -B) */
14101414

14111415
if (!skip_lines) { /* First draw gridlines, unless skip_lines is true */
1412-
gmt_setpen (GMT, &GMT->current.setting.map_grid_pen[GMT_PRIMARY]);
1416+
gmt_setpen(GMT, &GMT->current.setting.map_grid_pen[GMT_PRIMARY]);
14131417
for (i = 0; i < n_xpos; i++)
1414-
PSL_plotsegment (PSL, xpos[i], 0.0, xpos[i], width);
1418+
PSL_plotsegment(PSL, xpos[i], 0.0, xpos[i], width);
14151419
}
14161420

14171421
/* Then draw annotation and frame tickmarks */

0 commit comments

Comments
 (0)