@@ -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