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
Sebastian Heimann
grond
Commits
dadf0ecf
Commit
dadf0ecf
authored
Mar 07, 2017
by
Sebastian Heimann
Browse files
wip movie output
parent
5d05ae2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/core.py
View file @
dadf0ecf
...
@@ -1419,8 +1419,8 @@ def solve(problem,
...
@@ -1419,8 +1419,8 @@ def solve(problem,
if
plot
:
if
plot
:
from
matplotlib
import
pyplot
as
plt
from
matplotlib
import
pyplot
as
plt
from
grond
import
plot
as
gplot
from
grond
import
plot
as
gplot
plt
.
ion
()
#
plt.ion()
plt
.
show
()
#
plt.show()
solver_plot
=
gplot
.
SolverPlot
(
problem
,
plt
)
solver_plot
=
gplot
.
SolverPlot
(
problem
,
plt
)
while
iiter
<
niter
:
while
iiter
<
niter
:
...
@@ -1692,7 +1692,8 @@ def solve(problem,
...
@@ -1692,7 +1692,8 @@ def solve(problem,
iiter
+=
1
iiter
+=
1
if
plot
:
if
plot
:
plt
.
ioff
()
solver_plot
.
finish
()
#plt.ioff()
def
bootstrap_outliers
(
problem
,
misfits
,
std_factor
=
1.0
):
def
bootstrap_outliers
(
problem
,
misfits
,
std_factor
=
1.0
):
...
...
src/plot.py
View file @
dadf0ecf
...
@@ -1607,7 +1607,14 @@ class SolverPlot(object):
...
@@ -1607,7 +1607,14 @@ class SolverPlot(object):
self
.
cmap
=
LinearSegmentedColormap
.
from_list
(
'probability'
,
[
self
.
cmap
=
LinearSegmentedColormap
.
from_list
(
'probability'
,
[
(
1.0
,
1.0
,
1.0
),
(
1.0
,
1.0
,
1.0
),
(
0.5
,
0.9
,
0.6
)])
(
0.5
,
0.9
,
0.6
)])
from
matplotlib.animation
import
FFMpegWriter
metadata
=
dict
(
title
=
'Movie Test'
,
artist
=
'Matplotlib'
,
comment
=
'Movie support!'
)
self
.
writer
=
FFMpegWriter
(
fps
=
15
,
metadata
=
metadata
)
self
.
writer
.
setup
(
self
.
fig
,
'test.mp4'
,
dpi
=
100
)
def
set_limits
(
self
):
def
set_limits
(
self
):
self
.
axes
.
set_xlim
(
*
self
.
xlim
)
self
.
axes
.
set_xlim
(
*
self
.
xlim
)
...
@@ -1698,4 +1705,9 @@ class SolverPlot(object):
...
@@ -1698,4 +1705,9 @@ class SolverPlot(object):
edgecolors
=
'black'
)
edgecolors
=
'black'
)
self
.
set_limits
()
self
.
set_limits
()
self
.
plt
.
draw
()
#self.plt.draw()
self
.
writer
.
grab_frame
()
def
finish
(
self
):
self
.
writer
.
finish
()
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