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
Neel Shah
NIFTy
Commits
f87a6eed
Commit
f87a6eed
authored
Jul 17, 2018
by
Martin Reinecke
Browse files
tweaks
parent
36c7f0f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
nifty5/plotting
/plot_test.py
→
demos
/plot_test.py
View file @
f87a6eed
...
...
@@ -10,11 +10,12 @@ def plot_test():
fft
=
ift
.
FFTOperator
(
rg_space2
)
field_rg1_1
=
ift
.
Field
(
domain
=
rg_space1
,
val
=
np
.
random
.
randn
(
100
))
field_rg1_2
=
ift
.
Field
(
domain
=
rg_space1
,
val
=
np
.
random
.
randn
(
100
))
field_rg2
=
ift
.
Field
(
domain
=
rg_space2
,
val
=
np
.
random
.
randn
(
80
**
2
).
reshape
((
80
,
80
)))
field_hp
=
ift
.
Field
(
domain
=
hp_space
,
val
=
np
.
random
.
randn
(
12
*
64
**
2
))
field_gl
=
ift
.
Field
(
domain
=
gl_space
,
val
=
np
.
random
.
randn
(
32640
))
field_rg1_1
=
ift
.
Field
.
from_global_data
(
rg_space1
,
np
.
random
.
randn
(
100
))
field_rg1_2
=
ift
.
Field
.
from_global_data
(
rg_space1
,
np
.
random
.
randn
(
100
))
field_rg2
=
ift
.
Field
.
from_global_data
(
rg_space2
,
np
.
random
.
randn
(
80
**
2
).
reshape
((
80
,
80
)))
field_hp
=
ift
.
Field
.
from_global_data
(
hp_space
,
np
.
random
.
randn
(
12
*
64
**
2
))
field_gl
=
ift
.
Field
.
from_global_data
(
gl_space
,
np
.
random
.
randn
(
32640
))
field_ps
=
ift
.
power_analyze
(
fft
.
times
(
field_rg2
))
## Start various plotting tests
...
...
@@ -24,7 +25,8 @@ def plot_test():
ift
.
plot
(
field_rg2
,
title
=
'2d rg'
)
ift
.
plot
([
field_rg1_1
,
field_rg1_2
],
title
=
'list 1d rg'
,
label
=
[
'1'
,
'2'
])
ift
.
plot
(
field_rg1_2
,
title
=
'1d rg, xmin, ymin'
,
xmin
=
0.5
,
ymin
=
0.
,
xlabel
=
'xmin=0.5'
,
ylabel
=
'ymin=0'
)
ift
.
plot
(
field_rg1_2
,
title
=
'1d rg, xmin, ymin'
,
xmin
=
0.5
,
ymin
=
0.
,
xlabel
=
'xmin=0.5'
,
ylabel
=
'ymin=0'
)
ift
.
plot_finish
(
title
=
'Three plots'
)
ift
.
plot
(
field_hp
,
title
=
'HP planck-color'
,
colormap
=
'Planck-like'
)
...
...
@@ -36,4 +38,3 @@ def plot_test():
if
__name__
==
'__main__'
:
plot_test
()
nifty5/plotting/plot.py
View file @
f87a6eed
...
...
@@ -289,6 +289,7 @@ def _plot(f, ax, **kwargs):
raise
ValueError
(
"Field type not(yet) supported"
)
_plots
=
[]
_kwargs
=
[]
...
...
@@ -308,7 +309,8 @@ def plot_finish(**kwargs):
nx
=
kwargs
.
pop
(
"nx"
,
int
(
np
.
ceil
(
np
.
sqrt
(
nplot
))))
ny
=
kwargs
.
pop
(
"ny"
,
int
(
np
.
ceil
(
np
.
sqrt
(
nplot
))))
if
nx
*
ny
<
nplot
:
raise
ValueError
(
'Figure dimensions not sufficient for number of plots'
)
raise
ValueError
(
'Figure dimensions not sufficient for number of plots'
)
xsize
=
kwargs
.
pop
(
"xsize"
,
6
)
ysize
=
kwargs
.
pop
(
"ysize"
,
6
)
fig
.
set_size_inches
(
xsize
,
ysize
)
...
...
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