I have this code in matlab (in one function):
... m = size(myList, 3); for k = 1:m g = myList(:, :, k); image(g + 1) axis off axis square M(k) = getframe; end;
and in another file (another function):
... M = showGraphs(grids) movie(M, 1)
I want to make a movie in matplotlib. So far I have done (for the first part of the code):
m=sc.shape(myList,3) for k in range(m): g=myList[:,:,k] plt.axis("False") plt.imshow(g+1) -->> i don't know if it right
I do not know what to do with M(k)=getframe , and then with movie(M,1) .
How can I continue? because I got confused in matplotlib.
---- UPDATED ------------------------------
I did:
n=sc.shape(data)[2] ims=[] for i in range(n): mydata=data[:,:,i] im=plt.imshow(mydata,cmap=plt.get_cmap('jet')) ims.append([im]) return ims
and then:
fig=plt.gcf() ani=ArtistAnimation(fig,result,interval=10,repeat=False)
python matplotlib matlab
George Jan 19 '12 at 16:18 2012-01-19 16:18
source share