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
d2ca81ea
Commit
d2ca81ea
authored
6 years ago
by
Martin Reinecke
Browse files
Options
Downloads
Patches
Plain Diff
add documentation
parent
f87a6eed
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nifty5/plotting/plot.py
+48
-0
48 additions, 0 deletions
nifty5/plotting/plot.py
with
48 additions
and
0 deletions
nifty5/plotting/plot.py
+
48
−
0
View file @
d2ca81ea
...
...
@@ -295,11 +295,59 @@ _kwargs = []
def
plot
(
f
,
**
kwargs
):
"""
Add a figure to the current list of plots.
Notes
-----
After doing one or more calls `plot()`, one also needs to call
`plot_finish()` to output the result.
Parameters
----------
f: Field, or list of Field objects
If `f` is a single Field, it must live over a single `RGSpace`,
`PowerSpace`, `HPSpace`, `GLSPace`.
If it is a list, all list members must be Fields living over the same
one-dimensional `RGSpace` or `PowerSpace`.
Allowed key words:
title: string
title of the plot
xlabel: string
label for the x axis
ylabel: string
label for the y axis
[xyz]min, [xyz]max: float
limits for the values to plot
colormap: string
color map to use for the plot (if it is a 2D plot)
linewidth: float or list of floats
line width
label: string of list of strings
annotation string
alpha: float or list of floats
transparency value
"""
_plots
.
append
(
f
)
_kwargs
.
append
(
kwargs
)
def
plot_finish
(
**
kwargs
):
"""
Plot the accumulated list of figures
Allowed key words:
title: string
title of the full plot
nx, ny: integer (default: square root of the numer of plots in the list,
rounded up)
number of subplots to use in x- and y-direction
xsize, ysize: float (default: 6)
dimensions of the full plot in inches
name: string (default:
""
)
if left empty, the plot will be shown on the screen
otherwise it will be written to a file with the given name.
Supported extensions: .png and .pdf)
"""
global
_plots
,
_kwargs
import
matplotlib.pyplot
as
plt
nplot
=
len
(
_plots
)
...
...
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