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
1bc679ee
Commit
1bc679ee
authored
Jan 30, 2019
by
Philipp Arras
Browse files
Determine number of subplots more intelligently
parent
5667efb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty5/plot.py
View file @
1bc679ee
...
...
@@ -366,8 +366,14 @@ class Plot(object):
fig
=
plt
.
figure
()
if
"title"
in
kwargs
:
plt
.
suptitle
(
kwargs
.
pop
(
"title"
))
nx
=
kwargs
.
pop
(
"nx"
,
int
(
np
.
ceil
(
np
.
sqrt
(
nplot
))))
ny
=
kwargs
.
pop
(
"ny"
,
int
(
np
.
ceil
(
np
.
sqrt
(
nplot
))))
nx
=
kwargs
.
pop
(
"nx"
,
0
)
ny
=
kwargs
.
pop
(
"ny"
,
0
)
if
nx
==
ny
==
0
:
nx
=
ny
=
int
(
np
.
ceil
(
np
.
sqrt
(
nplot
)))
elif
nx
==
0
:
nx
=
np
.
ceil
(
nplot
/
ny
)
elif
ny
==
0
:
ny
=
np
.
ceil
(
nplot
/
nx
)
if
nx
*
ny
<
nplot
:
raise
ValueError
(
'Figure dimensions not sufficient for number of plots. '
...
...
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