mathause / mplotutils

helper functions for cartopy and matplotlib
MIT License
18 stars 3 forks source link

wrong x-ticks for +/- 180° #48

Open mathause opened 1 year ago

mathause commented 1 year ago

I think the problem is that it is just at the edge of the plot.

import numpy as np
import mplotutils as mpu
import cartopy.feature as cfeature
import cartopy.crs as ccrs
import matplotlib.pyplot as plt

%matplotlib

f, ax = plt.subplots(1, 1, subplot_kw=dict(projection=ccrs.Robinson(central_longitude=180)))

#ax.coastlines()

ax.set_global()

lat = np.arange(-90, 91, 20)
lon = np.arange(-180, 181, 60)

mpu.xticklabels(lon, ax=ax, size=8)

test