proplot-dev / proplot

🎨 A succinct matplotlib wrapper for making beautiful, publication-quality graphics
https://proplot.readthedocs.io
MIT License
1.11k stars 102 forks source link

Wrong zorder of land background #364

Open zxdawn opened 2 years ago

zxdawn commented 2 years ago

Description

If we plot the data first and then add the landcolor, the land will cover the data. It's better to set the land to the lowest zorder.

Steps to reproduce

import proplot as pplt
import numpy as np

offset = -40
lon = pplt.arange(offset, 360 + offset - 1, 60)
lat = pplt.arange(60, 70, 1)
state = np.random.RandomState(51423)
data = state.rand(len(lat), len(lon))

fig, axs = pplt.subplots(proj='npstere')
axs.pcolor(lon, lat, data, cmap='viridis')
axs.format(boundinglat=60, land=True, landcolor='gray5')

Expected behavior: Format axis before plot data:

axs.format(boundinglat=60, land=True, landcolor='gray5')
axs.pcolor(lon, lat, data, cmap='viridis')

image

Actual behavior: image

Proplot version

3.5.1
0.9.5.post202
zxdawn commented 2 years ago

Note that the coast should be kept as the highest zorder.