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

MAP_FRAME_PEN auto-scaling is not ideal in modern mode #6786

Open
seisman opened this issue Jun 10, 2022 · 6 comments
Open

MAP_FRAME_PEN auto-scaling is not ideal in modern mode #6786

seisman opened this issue Jun 10, 2022 · 6 comments
Labels
enhancement Improving an existing feature

Comments

@seisman
Copy link
Member

seisman commented Jun 10, 2022

Description of the problem

The following script plots three basemaps with different sizes (10c, 5c and 1c).

gmt begin map
gmt basemap -R0/10/0/10 -JX10c -B0
gmt colorbar -Crainbow -Baf

gmt basemap -R0/10/0/10 -JX5c -B0 -X10c
gmt colorbar -Crainbow -Baf

gmt basemap -R0/10/0/10 -JX1c -B0 -X5c
gmt colorbar -Crainbow -Baf
gmt end show

Here is the output image. As you can see, the frame pen thickness is almost identical (with very small thickness changes). The default pen thickness looks good for a 15-cm-wide basemap, but is too thick for a 5-cm-wide or 1-cm-wide basemap.

map

System information

  • GMT version (gmt --version): 6.4.0_a7493e9_2022.05.26
@seisman seisman added bug Something isn't working enhancement Improving an existing feature and removed bug Something isn't working labels Jun 10, 2022
@PaulWessel
Copy link
Member

Yes, it is not ideal, but I guess the auto-scaling was set up to get reasonable annotation font sizes for reasonable sizes. 1 cm maps are not reasonable and ends up with too large annotations and pen thicknesses. Given our font size scaling

fontsize = (2.0/15.0) * (map_dim_cm - 10.0) + 9; /* Gives result in points for plot dimension in cm */

and overall scale for thinkgs like pen widths:

scale = fontsize / 10.0; /* scaling for offsets, pen widths and lengths normalized to the modern 10p size */

the 1 cm map only yields a scale reduction of 0.78.

@seisman
Copy link
Member Author

seisman commented Jun 10, 2022

I agree that 1-cm-wide maps are not reasonable.

I feel that the pen thickness is still a little too thick for the colorbar for the 5-cm-wide maps. Compared to the 10-cm-wide maps, the height of the colorbar has a scale reduction of 0.5, but the colorbar frame pen thickness has a scale reduction of 0.83. I think that's why I have to change the frame pen thickness for most colorbars in my own plots.

@PaulWessel
Copy link
Member

I agree we need to do something about the colorbar pen.

@PaulWessel
Copy link
Member

Because the thickness of the bar is usually very small compared to its length, it is not helpful to use the same pen width as for the map. Even if we reduced it by the fractional length to map with (e.g. 0.8) it is still to think. Perhaps it is reasonable to simply use a factor of 0.5 * framepen->width for colorbars where framepen is the width scaled for the size of the map?

@PaulWessel
Copy link
Member

BTW, do you get this now after the cmocean merge?

gmt grdimage @earth_relief_01d -R0/30/0/40 -JM5c -B -png t
grdimage [ERROR]: File /Users/pwessel/UH/RESEARCH/CVSPROJECTS/GMTdev/gmt-dev/share/geo.cpt was not found

@PaulWessel
Copy link
Member

BTW, do you get this now after the cmocean merge?

gmt grdimage @earth_relief_01d -R0/30/0/40 -JM5c -B -png t
grdimage [ERROR]: File /Users/pwessel/UH/RESEARCH/CVSPROJECTS/GMTdev/gmt-dev/share/geo.cpt was not found

Never mind, went away after rebuild.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants