How to create a movie (in relation to Matlab)?

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) 
+1
python matplotlib matlab
Jan 19 '12 at 16:18
source share
1 answer

There are several different ways here, see animation examples: http://matplotlib.sourceforge.net/examples/animation/index.html

+1
Jan 19 '12 at 17:06
source share



All Articles