I'm trying to make a 2D color plot where the z-axis
> values show up as different colors for each (x,y) point.
> I tried to plot the list a+b+c+d using the code snipped
> below. I don't understand why this regular grid of
> points is giving me the weird color plot attached. Any
> help would be greatly appreciated.
> WHY DON't I SEE **SQUARES** OF COLORS IN ATTACHED
> PLOT???
Because you are not filling your arrays properly. Print xarray and
yarray in your example and you'll see the problem. In your example,
xarray is
[[ 1 2 3 4]
[ 5 6 7 8]
[ 9 10 1 2]
[ 3 4 5 6]
[ 7 8 9 10]
[ 1 2 3 4]
[ 5 6 7 8]
[ 9 10 1 2]
[ 3 4 5 6]
[ 7 8 9 10]]
is which is causing the weird plots you observe.
In your script, the problem line is
xarray.shape = yarray.shape = zarray.shape = xsize, ysize
replace this with
xarray.shape = yarray.shape = zarray.shape = ysize, xsize
and you'll get the pcolor you are looking for, I suspect.
JDH