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
ift
NIFTy
Commits
8662faa1
Commit
8662faa1
authored
Apr 17, 2020
by
Philipp Arras
Browse files
Adapt to matplotlib names
parent
bbd94ccc
Pipeline
#75327
passed with stages
in 8 minutes and 37 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty6/plot.py
View file @
8662faa1
...
@@ -417,7 +417,7 @@ def _plot2D(f, ax, **kwargs):
...
@@ -417,7 +417,7 @@ def _plot2D(f, ax, **kwargs):
else
:
else
:
im
=
ax
.
imshow
(
im
=
ax
.
imshow
(
f
.
val
.
T
,
extent
=
[
0
,
nx
*
dx
,
0
,
ny
*
dy
],
f
.
val
.
T
,
extent
=
[
0
,
nx
*
dx
,
0
,
ny
*
dy
],
vmin
=
kwargs
.
get
(
"
z
min"
),
vmax
=
kwargs
.
get
(
"
z
max"
),
vmin
=
kwargs
.
get
(
"
v
min"
),
vmax
=
kwargs
.
get
(
"
v
max"
),
cmap
=
cmap
,
origin
=
"lower"
,
**
norm
,
**
aspect
)
cmap
=
cmap
,
origin
=
"lower"
,
**
norm
,
**
aspect
)
plt
.
colorbar
(
im
)
plt
.
colorbar
(
im
)
_limit_xy
(
**
kwargs
)
_limit_xy
(
**
kwargs
)
...
@@ -453,7 +453,7 @@ def _plot2D(f, ax, **kwargs):
...
@@ -453,7 +453,7 @@ def _plot2D(f, ax, **kwargs):
if
have_rgb
:
if
have_rgb
:
plt
.
imshow
(
res
,
origin
=
"lower"
)
plt
.
imshow
(
res
,
origin
=
"lower"
)
else
:
else
:
plt
.
imshow
(
res
,
vmin
=
kwargs
.
get
(
"
z
min"
),
vmax
=
kwargs
.
get
(
"
z
max"
),
plt
.
imshow
(
res
,
vmin
=
kwargs
.
get
(
"
v
min"
),
vmax
=
kwargs
.
get
(
"
v
max"
),
norm
=
norm
.
get
(
'norm'
),
cmap
=
cmap
,
origin
=
"lower"
)
norm
=
norm
.
get
(
'norm'
),
cmap
=
cmap
,
origin
=
"lower"
)
plt
.
colorbar
(
orientation
=
"horizontal"
)
plt
.
colorbar
(
orientation
=
"horizontal"
)
return
return
...
...
test/test_plot.py
View file @
8662faa1
...
@@ -54,7 +54,7 @@ def test_plots():
...
@@ -54,7 +54,7 @@ def test_plots():
plot
.
output
(
title
=
'Three plots'
,
name
=
next
(
name
))
plot
.
output
(
title
=
'Three plots'
,
name
=
next
(
name
))
plot
=
ift
.
Plot
()
plot
=
ift
.
Plot
()
plot
.
add
(
field_hp
,
title
=
'HP planck-color'
,
c
olor
map
=
'Planck-like'
)
plot
.
add
(
field_hp
,
title
=
'HP planck-color'
,
cmap
=
'Planck-like'
)
plot
.
add
(
field_rg1_2
,
title
=
'1d rg'
)
plot
.
add
(
field_rg1_2
,
title
=
'1d rg'
)
plot
.
add
(
field_ps
)
plot
.
add
(
field_ps
)
plot
.
add
(
field_gl
,
title
=
'GL'
)
plot
.
add
(
field_gl
,
title
=
'GL'
)
...
...
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