Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
d0485540
Commit
d0485540
authored
Sep 08, 2017
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only load matplotlib when needed
parent
386d2f0e
Pipeline
#17979
passed with stage
in 4 minutes and 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
nifty2go/plotting/plot.py
nifty2go/plotting/plot.py
+2
-1
No files found.
nifty2go/plotting/plot.py
View file @
d0485540
from
__future__
import
division
import
matplotlib.pyplot
as
plt
import
numpy
as
np
from
..
import
Field
,
RGSpace
,
HPSpace
,
GLSpace
,
PowerSpace
import
os
...
...
@@ -42,6 +41,7 @@ def _find_closest(A, target):
return
idx
def
_makeplot
(
name
):
import
matplotlib.pyplot
as
plt
if
name
is
None
:
plt
.
show
()
return
...
...
@@ -66,6 +66,7 @@ def _makeplot(name):
raise
ValueError
(
"file format not understood"
)
def
plot
(
f
,
name
=
None
):
import
matplotlib.pyplot
as
plt
if
not
isinstance
(
f
,
Field
):
raise
TypeError
(
"incorrect data type"
)
if
len
(
f
.
domain
)
!=
1
:
...
...
Write
Preview
Markdown
is supported
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