Commit 10d7a085 authored by Daniel Böckenhoff (Laptop)'s avatar Daniel Böckenhoff (Laptop)
Browse files

presentation new problem

parent afe4fbec
This diff is collapsed.
This diff is collapsed.
...@@ -1503,6 +1503,26 @@ class TensorFields(Tensors): ...@@ -1503,6 +1503,26 @@ class TensorFields(Tensors):
weights = self.fields[weights] weights = self.fields[weights]
return super(TensorFields, self)._weights(weights, rigid=rigid) return super(TensorFields, self)._weights(weights, rigid=rigid)
def plot(self, **kwargs):
"""
Override Tensors plot method:
By default, vector fields are plotted with the quiver method
"""
field_index = kwargs.pop('field_index', None)
if field_index is None:
artist = super(TensorFields, self).plot(**kwargs)
else:
field = self.fields[field_index]
if field.dim == 1:
artist = super(TensorFields, self).plot(c=field, **kwargs)
elif field.dim in (2, 3):
artist = tfields.plotting.plot_tensor_field(self, field,
**kwargs)
else:
raise NotImplementedError("Field of dimension {field.dim}"
.format(**locals()))
return artist
class TensorMaps(TensorFields): class TensorMaps(TensorFields):
""" """
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment