I am trying to create subplots with matshow. However, my code seems to be displaying only the last matshow image and two blank plots in separate figures. Can someone tell me what I am doing wrong?
from matplotlib.pylab import * def SliceMat(N, i): slice = zeros( (N, N) ) for j in range(N): for k in range(N): val = 0 # black if(i>j>k and ((i+j+k)%3==1)): val=1 # red if(j>k>i and ((i+j+k)%3==2)): val=2 # yellow if (k>i>j and ((i+j+k)%3==0)): val=3 # white slice[j,k] = val return slice N=8 subplot(121) slice = SliceMat(N, 2) matshow(slice, cmap=cm.hot, origin='lower') subplot(122) slice = SliceMat(N, 5) matshow(slice, cmap=cm.hot, origin='lower') show() _________________________________________________________________ Connect with your friends who use Yahoo! Messenger with Voice. Click! http://www.msnspecials.in/wlmyahoo/index.asp ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users