Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NIFTy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ift
NIFTy
Commits
d0485540
There was a problem fetching the pipeline summary.
Commit
d0485540
authored
7 years ago
by
Martin Reinecke
Browse files
Options
Downloads
Patches
Plain Diff
only load matplotlib when needed
parent
386d2f0e
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nifty2go/plotting/plot.py
+2
-1
2 additions, 1 deletion
nifty2go/plotting/plot.py
with
2 additions
and
1 deletion
nifty2go/plotting/plot.py
+
2
−
1
View file @
d0485540
from
__future__
import
division
from
__future__
import
division
import
matplotlib.pyplot
as
plt
import
numpy
as
np
import
numpy
as
np
from
..
import
Field
,
RGSpace
,
HPSpace
,
GLSpace
,
PowerSpace
from
..
import
Field
,
RGSpace
,
HPSpace
,
GLSpace
,
PowerSpace
import
os
import
os
...
@@ -42,6 +41,7 @@ def _find_closest(A, target):
...
@@ -42,6 +41,7 @@ def _find_closest(A, target):
return
idx
return
idx
def
_makeplot
(
name
):
def
_makeplot
(
name
):
import
matplotlib.pyplot
as
plt
if
name
is
None
:
if
name
is
None
:
plt
.
show
()
plt
.
show
()
return
return
...
@@ -66,6 +66,7 @@ def _makeplot(name):
...
@@ -66,6 +66,7 @@ def _makeplot(name):
raise
ValueError
(
"
file format not understood
"
)
raise
ValueError
(
"
file format not understood
"
)
def
plot
(
f
,
name
=
None
):
def
plot
(
f
,
name
=
None
):
import
matplotlib.pyplot
as
plt
if
not
isinstance
(
f
,
Field
):
if
not
isinstance
(
f
,
Field
):
raise
TypeError
(
"
incorrect data type
"
)
raise
TypeError
(
"
incorrect data type
"
)
if
len
(
f
.
domain
)
!=
1
:
if
len
(
f
.
domain
)
!=
1
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment