Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't change font and offset of colorbar's Y label #6799

Open
seisman opened this issue Jun 17, 2022 · 2 comments
Open

Can't change font and offset of colorbar's Y label #6799

seisman opened this issue Jun 17, 2022 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@seisman
Copy link
Member

seisman commented Jun 17, 2022

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

map

System information

  • GMT version (gmt --version): 6.4.0
@seisman seisman added the bug Something isn't working label Jun 17, 2022
@PaulWessel PaulWessel self-assigned this Jun 17, 2022
@PaulWessel
Copy link
Member

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.

@PaulWessel
Copy link
Member

For reference, the proposed PR makes this plot:

map

@PaulWessel PaulWessel added this to the 6.5.0 milestone Jun 19, 2022
@seisman seisman modified the milestones: 6.4.0, 6.5.0 Jun 25, 2022
@seisman seisman modified the milestones: 6.5.0, 6.6.0 Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants