gmt
gmt copied to clipboard
Can't change font and offset of colorbar's Y label
Description of the problem
As shown below, MAP_LABLE_OFFSET
and FONT_LABEL
can control the X label, but have no effects on the Y label.
gmt colorbar -Cseis -Djx0c/0c+h -R0/10/0/10 -JX10c -Bxaf+l"Xaxis" -By+l"Depth" --MAP_LABEL_OFFSET=20p --FONT_LABEL=10p,1 -png map
System information
- GMT version (
gmt --version
): 6.4.0
True. The code shows this:
if (label[0]) { /* Add label */
form = gmt_setfont (GMT, &GMT->current.setting.font_label);
gmt_map_text (GMT, xleft + 0.5 * length, y_label, &GMT->current.setting.font_label, label, 0.0, Label_justify, form);
}
if (unit[0]) { /* Add unit label */
form = gmt_setfont (GMT, &GMT->current.setting.font_annot[GMT_PRIMARY]);
So the y-label uses the annotation font as you show. I cannot see anything in the documentation that says this is how it is supposed to work, so I think we can declare a bug and change this to FONT_LABEL. Agreed? It is possible this will require updated PS files for those cases with y-labels on color bars.
For reference, the proposed PR makes this plot: