Coastlines get blurred after setting COLOR_NAN="white"

Hello everyone! Thank you for taking the time to read my question.
I am plotting data of NOx concentrations. To get a white background, I set all values below a certain threshold to NaN and used COLOR_NAN=“white” when making the figures. The problem is that the shorelines turn to a grayish color when making the maps despite setting it to black, and I think it is because of the white NaNs. I have tried different things, like changing the transparency of the CMAP and the plotted data, but it didn’t work. I also tried changing the plotting order between all the elements (data, coast, and base map) but failed to have black shorelines.

Do you have any advice on how I could make the shorelines look black on my maps?

I appreciate any insights you can provide on this.


The code I am using:

fig.basemap(frame=["afg"], region=[-180, 180, -65, 85], projection="Cyl_stere/30/-20/10c")
pygmt.makecpt(cmap="panoply", series=[1, 13], overrule_bg=True)
fig.plot(x=data.lon,, color=data.NO2, style="c0.1c", cmap=True, region=[-180, 180, -65, 85], projection="Cyl_stere/30/-20/10c")
fig.colorbar(position="JBC+w4h", frame=["af", "y+l10@+15@+("])
fig.coast(land="white", water="white", shorelines="1/1p,black", borders=["1/0.7p"],  region=[-180, 180, -65, 85], projection="Cyl_stere/30/-20/10c", transparency=90)

Hello @JairoVS,

I feel the effect of very light gray shorelines and borders is caused by transparency=90, leading to a transparency of 90 % for everything plotted by coast. To set the transparency for only one parameter, e.g., land you can use an argument in the form land="color@transparency".

1 Like

Thank you so much @yvonnefroehlich! Appreciate your prompt answer. I set land=white@90 and now shorelines are black.