Is there a simpler way to outline fonts with an different color outline? I am able to use the style for the plot function, but the buffer propagates inward causing the initial color to be covered up. This is bad for fonts that have thinner strokes like Times Roman.
I was able to fix this by first plotting the outline and then overlaying the filled text like so:
import pygmt
fig = pygmt.Figure()
region = [-65, -40, -40, -20]
grid = pygmt.grdlandmask(region=region, spacing="5m", maskvalues=[0, 1], resolution="l")
fig.basemap(region=region, projection="M12c", frame=True)
pygmt.makecpt(cmap="batlow", series=(0, 1, 1), color_model="+cwater,land")
fig.grdimage(grid=grid, cmap=True)
# bad looking
fig.plot(x=-45, y=-25, style="l9p+tLabel+fTimes-Roman,black=0.3p,white")
# corrected
fig.plot(x=-45, y=-30, style="l9p+tLabel+fTimes-Roman,-=1.0p,white")
fig.plot(x=-45, y=-30, style="l9p+tLabel+fTimes-Roman", color="black")
I just don’t know if there’s a better way to do this or if you can get the buffer to be drawn before the base fill.