[SciPy-user] Stupid plot question

Ryan James rgjames at ucdavis.edu
Thu Nov 20 12:56:36 EST 2008


On Thu, 2008-11-20 at 18:02 +0100, Marco wrote:
> I have a 2d matrix with some values in it: basically they are just
> ones or minus ones, and I want to plot them putting a red "square" (or
> "ball" or "something") on screen (on a grid) if the value of that
> matrix element is one and a blue "something" if it is minus one.

There's also:

M = array([randint(0, 2) for i in xrange(100)]).reshape((10,10))
M = 2*M - 1
matshow(M)

ryan




More information about the SciPy-User mailing list