in reply to matrix 'graphic' problem

Take a step back, what are you really trying to do? It's hard to imagine what your real goal is based on what you've told us. What are you trying to visualize?

Given just what you've asked, I'd say you should take a look at Imager (or possible Image::Magick or GD, although I much prefer Imager). You can easily create an image with colored boxes for your coordinates using that library.

-sam