@@ -85,10 +85,19 @@ def _create_logo( # noqa: PLR0915
8585 pheight = 0.739 # Height of letter "P"
8686 plsb = 0.076 # Left side bearing of letter "P"
8787 pstroke = 0.0735 # Stroke thickness of letter "P"
88+ pygmtwidth = 3.262 # Full width of "PyGMT"
8889
8990 match wordmark :
9091 case "vertical" :
91- args_wordmark = {"x" : 0 , "y" : - 4.5 , "justify" : "CT" , "font" : f"2.4c,{ font } " }
92+ # Ensure the same width for the visual logo and wordmark
93+ fontsize = size * 2.0 / pygmtwidth
94+ args_wordmark = {
95+ "x" : - size - fontsize * plsb ,
96+ "y" : - size * 1.375 , # Center of the wordmark.
97+ "justify" : "ML" ,
98+ "font" : f"{ fontsize } c,{ font } " ,
99+ "no_clip" : True , # Needed because x<xmin.
100+ }
92101 case "horizontal" :
93102 # The stroke width matches the outline thickness.
94103 # The left edge of "P" is aligned at y=size * 1.25.
@@ -257,6 +266,8 @@ def _compass_lines():
257266 halfheight = pheight / 2.0 * fontsize
258267 fig .hlines (y = [- halfheight , halfheight ], xmin = size , pen = pen )
259268 fig .vlines (x = [size * 1.25 , size * 1.25 + pstroke * fontsize ], pen = pen )
269+ elif wordmark == "vertical" :
270+ fig .hlines (y = - size * 1.375 , pen = pen )
260271
261272 if figname :
262273 fig .savefig (fname = figname )
0 commit comments