Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
1bd24498
Commit
1bd24498
authored
Mar 01, 2018
by
Philipp Arras
Browse files
Add kwargs
parent
e110e7d5
Pipeline
#25643
passed with stage
in 5 minutes and 39 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
nifty4/plotting/plot.py
View file @
1bd24498
...
...
@@ -198,6 +198,18 @@ def plot(f, **kwargs):
if
not
isinstance
(
label
,
list
):
label
=
[
label
]
linewidth
=
_get_kw
(
"linewidth"
,
None
,
**
kwargs
)
if
linewidth
is
None
:
linewidth
=
[
None
]
*
len
(
f
)
if
not
isinstance
(
linewidth
,
list
):
linewidth
=
[
linewidth
]
alpha
=
_get_kw
(
"alpha"
,
None
,
**
kwargs
)
if
alpha
is
None
:
alpha
=
[
None
]
*
len
(
f
)
if
not
isinstance
(
alpha
,
list
):
alpha
=
[
alpha
]
dom
=
dom
[
0
]
fig
=
plt
.
figure
()
ax
=
fig
.
add_subplot
(
1
,
1
,
1
)
...
...
@@ -216,7 +228,7 @@ def plot(f, **kwargs):
xcoord
=
np
.
arange
(
npoints
,
dtype
=
np
.
float64
)
*
dist
for
i
,
fld
in
enumerate
(
f
):
ycoord
=
fld
.
to_global_data
()
plt
.
plot
(
xcoord
,
ycoord
,
label
=
label
[
i
])
plt
.
plot
(
xcoord
,
ycoord
,
label
=
label
[
i
]
,
linewidth
=
linewidth
[
i
],
alpha
=
alpha
[
i
]
)
_limit_xy
(
**
kwargs
)
if
label
!=
([
None
]
*
len
(
f
)):
plt
.
legend
()
...
...
@@ -249,7 +261,7 @@ def plot(f, **kwargs):
xcoord
=
dom
.
k_lengths
for
i
,
fld
in
enumerate
(
f
):
ycoord
=
fld
.
to_global_data
()
plt
.
plot
(
xcoord
,
ycoord
,
label
=
label
[
i
])
plt
.
plot
(
xcoord
,
ycoord
,
label
=
label
[
i
]
,
linewidth
=
linewidth
[
i
],
alpha
=
alpha
[
i
]
)
_limit_xy
(
**
kwargs
)
if
label
!=
([
None
]
*
len
(
f
)):
plt
.
legend
()
...
...
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