From e35f6b214ccf448022f53e7b0d892b9e022c766b Mon Sep 17 00:00:00 2001 From: Lachlan Grose Date: Thu, 14 Oct 2021 16:17:48 +1100 Subject: [PATCH] fix: plot vector field crashing model plotter vector field was using wrong argument order for add_vector_marker --- LoopStructural/visualisation/model_plotter.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LoopStructural/visualisation/model_plotter.py b/LoopStructural/visualisation/model_plotter.py index 58eb98a3b..68487c9ba 100644 --- a/LoopStructural/visualisation/model_plotter.py +++ b/LoopStructural/visualisation/model_plotter.py @@ -447,7 +447,7 @@ def add_fault_displacements(self, cmap = 'rainbow', **kwargs): name = kwargs.get('name', 'fault_displacements') points, tri = create_box(self.bounding_box, self.nsteps) - self._add_surface(tri, points,name, cmap=cmap) # need to pass colour somehow + self._add_surface(tri, points,name, paint_with=self.model.evaluate_fault_displacements,cmap=cmap) # need to pass colour somehow def add_fault(self,fault,step=100): @@ -599,8 +599,8 @@ def add_vector_field(self, geological_feature, **kwargs): ------- """ - if isinstance(geological_feature,GeologicalFeature): - raise ValueError("{} is not a GeologicalFeature".format(type(geological_feature))) + # if isinstance(geological_feature,GeologicalFeature): + # raise ValueError("{} is not a GeologicalFeature".format(type(geological_feature))) logger.info("Adding vector field for %s " % (geological_feature.name)) locations = kwargs.get('locations', None) name = kwargs.get('name', geological_feature.name) @@ -614,7 +614,7 @@ def add_vector_field(self, geological_feature, **kwargs): # normalise mask = ~np.any(np.isnan(vector), axis=1) vector[mask, :] /= np.linalg.norm(vector[mask, :], axis=1)[:, None] - self._add_vector_marker(name, locations, vector, **kwargs) + self._add_vector_marker(locations, vector, name, **kwargs) return