views:

56

answers:

2

How can I draw only half of a matrix, e.g. the upper / lower part of a matrix, with pcolor for example?

Suppose I have a n x n matrix and I draw it using pcolor(my_matrix). I want only the lower half to be shown since other values are redundant. How can this be done?

thanks.

A: 

Use set_ylim:

X = scipy.rand(10,10)
f = pylab.figure()
ax = f.add_subplot(1,1,1)
ax.pcolor(X)
ax.set_ylim([0,5])
f.show()
Steve
+1  A: 

Is it OK to plot zeros in the other half?

pcolor(mat*tri(*shape(mat)))
Jouni K. Seppänen