Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel Boeckenhoff
tfields
Commits
10d7a085
Commit
10d7a085
authored
Apr 02, 2019
by
Daniel Böckenhoff (Laptop)
Browse files
presentation new problem
parent
afe4fbec
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
examples/presentation/presentation.ipynb
View file @
10d7a085
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
tfields/core.py
View file @
10d7a085
...
...
@@ -1503,6 +1503,26 @@ class TensorFields(Tensors):
weights
=
self
.
fields
[
weights
]
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
):
"""
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment