Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plotter-nse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
数学の武士
plotter-nse
Commits
aab09f13
Commit
aab09f13
authored
2 years ago
by
数学の武士
Browse files
Options
Downloads
Patches
Plain Diff
Hotfix
parent
75c1e8c8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
plotter/Plotter.py
+7
-2
7 additions, 2 deletions
plotter/Plotter.py
with
7 additions
and
2 deletions
plotter/Plotter.py
+
7
−
2
View file @
aab09f13
...
@@ -13,6 +13,7 @@ class Plotter:
...
@@ -13,6 +13,7 @@ class Plotter:
ani_pngs_dir
=
"
plotter_lib_pngs/
"
ani_pngs_dir
=
"
plotter_lib_pngs/
"
def
__init__
(
self
):
def
__init__
(
self
):
self
.
ani_period
=
float
(
1
/
10
)
self
.
filename
=
None
self
.
filename
=
None
self
.
out
=
None
self
.
out
=
None
self
.
oname
=
None
self
.
oname
=
None
...
@@ -162,6 +163,8 @@ class Plotter:
...
@@ -162,6 +163,8 @@ class Plotter:
else
:
else
:
min_val
=
self
.
min_y
[
0
]
min_val
=
self
.
min_y
[
0
]
duration
=
self
.
ani_period
*
len
(
names
)
for
datafile
in
names
:
for
datafile
in
names
:
fig
=
plt
.
figure
()
fig
=
plt
.
figure
()
plt
.
ylim
([
min_val
,
max_val
])
plt
.
ylim
([
min_val
,
max_val
])
...
@@ -184,7 +187,7 @@ class Plotter:
...
@@ -184,7 +187,7 @@ class Plotter:
for
file_name
in
png_names
:
for
file_name
in
png_names
:
images
.
append
(
imageio
.
v2
.
imread
(
file_name
))
images
.
append
(
imageio
.
v2
.
imread
(
file_name
))
imageio
.
mimsave
(
self
.
oname
[
0
],
images
,
duration
=
20
,
loop
=
0
)
imageio
.
mimsave
(
self
.
oname
[
0
],
images
,
duration
=
duration
,
loop
=
0
)
shutil
.
rmtree
(
self
.
ani_pngs_dir
)
shutil
.
rmtree
(
self
.
ani_pngs_dir
)
def
__plot_contour
(
self
):
def
__plot_contour
(
self
):
...
@@ -289,6 +292,8 @@ class Plotter:
...
@@ -289,6 +292,8 @@ class Plotter:
# print(max_val)
# print(max_val)
duration
=
self
.
ani_period
*
len
(
self
.
filename
)
i
=
0
i
=
0
for
var
in
self
.
var
:
for
var
in
self
.
var
:
if
self
.
title
==
None
:
if
self
.
title
==
None
:
...
@@ -319,7 +324,7 @@ class Plotter:
...
@@ -319,7 +324,7 @@ class Plotter:
for
file_name
in
png_names
:
for
file_name
in
png_names
:
images
.
append
(
imageio
.
v2
.
imread
(
file_name
))
images
.
append
(
imageio
.
v2
.
imread
(
file_name
))
imageio
.
mimsave
(
self
.
out
+
fig_names
[
i
]
+
fig_end
,
images
,
duration
=
5
,
)
imageio
.
mimsave
(
self
.
out
+
fig_names
[
i
]
+
fig_end
,
images
,
duration
=
duration
,
loop
=
0
)
i
+=
1
i
+=
1
shutil
.
rmtree
(
self
.
ani_pngs_dir
)
shutil
.
rmtree
(
self
.
ani_pngs_dir
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment