From 3f98938d3ef01241cfc2a5162c2e5d2e98af6495 Mon Sep 17 00:00:00 2001 From: rowanc1 Date: Tue, 18 Feb 2014 14:20:21 -0800 Subject: [PATCH] quiver --> streamline --- SimPEG/Mesh/TensorView.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/SimPEG/Mesh/TensorView.py b/SimPEG/Mesh/TensorView.py index b91f5fae..ef0957eb 100644 --- a/SimPEG/Mesh/TensorView.py +++ b/SimPEG/Mesh/TensorView.py @@ -243,7 +243,7 @@ class TensorView(object): ax=None, clim=None, showIt=False, gridOpts={'color':'k'} ): - viewOpts = ['real','imag','abs','vec','|vec|'] + viewOpts = ['real','imag','abs','vec'] normalOpts = ['X', 'Y', 'Z'] vTypeOpts = ['CC','F','E'] @@ -258,11 +258,6 @@ class TensorView(object): if ind is None: ind = int(szSliceDim/2) assert type(ind) in [int, long], 'ind must be an integer' - normalizeVector = False - if view == '|vec|': - view = 'vec' - normalizeVector = True - if ax is None: fig = plt.figure(1) fig.clf() @@ -313,10 +308,7 @@ class TensorView(object): if clim is None: clim = [v.min(),v.max()] out += (ax.pcolormesh(tM.vectorNx, tM.vectorNy, 0.5*(U+V).T, vmin=clim[0], vmax=clim[1]),) - if normalizeVector: - length = np.sqrt(U**2+V**2) - U, V = U/length, V/length - out += (plt.quiver( tM.gridCC[:,0], tM.gridCC[:,1], U, V),) + out += (plt.streamplot(tM.vectorCCx, tM.vectorCCy, U.T, V.T),) if grid: xXGrid = np.c_[tM.vectorNx,tM.vectorNx,np.nan*np.ones(tM.nNx)].flatten()