Closed
Description
This file with 2D longitude/latitude arrays causes a weird streaking issue when you do a pcolormesh
plot.
import os
import xarray as xr
file = os.path.expanduser('~/Downloads/data.for.luke.nc')
data = xr.open_dataset(file)
# proplot
levels = plot.arange(0, 0.012, 0.001)
import proplot as plot
f, ax = plot.subplots(proj='cyl', width=5)
ax.pcolormesh(data.ULONG, co2.ULAT, data.PH_ALT_CO2, levels=levels, cmap='Fire', colorbar='b')
ax.format(facecolor='gray')
# pyplot
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
f, ax = plt.subplots(figsize=(5,3.5), subplot_kw={'projection':ccrs.PlateCarree()})
c = ax.pcolormesh(data.ULONG, co2.ULAT, data.PH_ALT_CO2, # levels=levels,
vmin=min(levels), vmax=max(levels),
cmap='Fire', transform=ccrs.PlateCarree())
f.colorbar(c, ax=ax, orientation='horizontal')
ax.patch.set_facecolor('gray')
f.subplots_adjust(0.02, 0.02, 0.98, 0.98)