I am trying to plot categorial precipitation type and I have a colormap I want to use as the array either includes -0.99 (no precip) or 0.99 (precip). I want to know how to only plot when the data is equal to 0.99. Currently this is the code I am trying and it is just plotting my whole map pink. Is there a better way to do this?
import matplotlib as mpl
from matplotlib import colors
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
proj = ccrs.LambertConformal(central_longitude=cLon,
central_latitude=cLat)
fig = plt.figure(figsize=(12,12),dpi=100) # Increase the dots per inch from default 100 to make plot easier to read
ax = fig.add_subplot(1,1,1,projection=proj)
ax.set_extent ([lonW,lonE,latS,latN])
ptype_colors_fzra = ['deeppink']
cmap_ptype_ext_fzra = mpl.colors.ListedColormap(ptype_colors_fzra)
norm_ptype_ext_fzra = mpl.colors.BoundaryNorm([0.98,1],ncolors = len(ptype_colors_fzra))
ax.contourf(lons, lats, cfzra, cmap = cmap_ptype_ext_fzra, norm = norm_ptype_ext_fzra,
transform = ccrs.PlateCarree(), zorder = 2)
This is what ends up plotting
