Skip to content
Snippets Groups Projects
Commit aab09f13 authored by 数学の武士's avatar 数学の武士
Browse files

Hotfix

parent 75c1e8c8
No related branches found
No related tags found
No related merge requests found
...@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment