I'm trying to increase the density of hatch marks I have for a map. This is how I'm currently doing it and I can't get anything to show up on my map when it should. I want to contour values less than 0.05 (sig p-valuea). And repeating the type of hashing I want doesn't help with the problem.
levels = [spnewdata[:,:,1].min(), 0.05]
cs1 = plt.contour(x, y, spnewdata[:,:,1],levels=levels, colors='none', hatch='X', alpha=0)
Edit:
Here's a little more complete form of the code I'm using to make the maps. I've tried both plt.contour
and plt.contourf
and neither work. However I do know there should be values under 0.05 in the data, so I know that is not the issue here.
import matplotlib as mpl
import matplotlib.pylab as plt
plt.figure(1,figsize=(10, 8))
# Setting a cylindrical coordinate map
map = Basemap(projection='cyl',\
llcrnrlat=LLlat,urcrnrlat=URlat,\
llcrnrlon=LLlon,urcrnrlon=URlon,\
rsphere=6371200.,resolution='i')
map.drawcoastlines(linewidth=0.5) # Draw some coastlines
lons,lats = map(lon,lat) # Setting up the grid in cylindrical coords.
cs = plt.contourf(lons,lats,spnewdata[:,:,0],np.arange(-.3,.4,.1),cmap=plt.cm.RdYlBu, extend='both')
x, y =(lons, lats)
levels = [spnewdata[:,:,1].min(), 0.05]
cs1 = plt.contour(x, y, spnewdata[:,:,1],levels=levels, colors='none', hatch='X', alpha=0)`