heatmap2 (meshgrid)

This script plots a mesh grid (or heat map)

The np.meshgrid generates the series of (x,y) for the given x and y ranges.

e.g. x goes from 1 to 2, and y goes from 3 to 4 so grid will be:

4 (1,4) (2,4) 

3 (1,3) (2,3)

    1     2

Each value in the grid needs to be presented so the series are

x series (xx) = 1, 2, 1, 2

y series (yy) = 3, 3, 4, 4

Totally 4 dots in the grid.

The following script uses zz as the response value

The pcolormesh draws the grid with a color map = paired which is a type of color schemes.

import numpy as np

import matplotlib.pyplot as plt

xx, yy = np.meshgrid( np.arange(15,95,5), np.arange(0,11,1))

zz = xx /10 + yy/5

plt.figure(1, figsize=(4, 3))

plt.pcolormesh(xx, yy, zz, cmap=plt.cm.Paired)

plt.show()