Bug fix if no colorer is used in the video.

This commit is contained in:
rowanc1
2013-11-26 17:31:42 -08:00
parent a6e2686f09
commit e2943ba56e
+3 -2
View File
@@ -372,7 +372,7 @@ class TensorView(object):
return animate(fig, animateFrame, frames=mesh.nCv['xyz'.index(normal)])
def video(mesh,var,function,figsize=(10,8)):
def video(mesh,var,function,figsize=(10,8),colorbar=True):
"""
Call a function for a list of models to create a video.
@@ -390,7 +390,8 @@ class TensorView(object):
VAR = np.concatenate(var)
clim = [VAR.min(),VAR.max()]
tlt = plt.title('')
plt.colorbar(function(var[0],ax,clim,tlt,0))
if colorbar:
plt.colorbar(function(var[0],ax,clim,tlt,0))
def animateFrame(i):
function(var[i],ax,clim,tlt,i)