2D grid data visualization in Python
Matplotlib has the imshow method for plotting arrays: import matplotlib as mpl from matplotlib import pyplot import numpy as np # make values from -5 to 5, for this example zvals = np.random.rand(100,100)*10-5 # make a color map of fixed colors cmap = mpl.colors.ListedColormap([‘blue’,’black’,’red’]) bounds=[-6,-2,2,6] norm = mpl.colors.BoundaryNorm(bounds, cmap.N) # tell imshow about color map … Read more