I just wasted quite a bit of time trying to debug my code. It took a long time because I was using imshow to debug, and didn't know that imshow displays a matrix not using cartesian coordinates. The axes are transposed and one axis is reversed. The documentation doesn't mention this. Thanks, Neal