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

Multiple figs by variables in file:

 plot, ani_plot, multiple_plot
parent 16d9d896
No related branches found
No related tags found
No related merge requests found
......@@ -106,37 +106,49 @@ class Plotter:
os.system("mkdir -p " + self.out)
x_name = self.file_column_names[0]
fig = plt.figure()
if self.oname == None:
fig_names = self.var
fig_end = ".png"
else:
fig_names = self.oname
fig_end = ""
for y_name in self.var:
for i in range(self.fig_count):
y_name = self.var[i]
fig = plt.figure()
plt.plot(self.file_data[0].data[x_name], self.file_data[0].data[y_name], linewidth=4)
plt.legend(self.var)
plt.xlabel(x_name, fontsize=10, fontweight='bold')
plt.xlabel(y_name, fontsize=10, fontweight='bold')
if self.if_manual_plot: plt.show()
else: plt.close(fig)
if self.if_save_result: fig.savefig(self.out + self.oname[0])
plt.xlabel(x_name, fontsize=10, fontweight='bold')
plt.ylabel(y_name, fontsize=10, fontweight='bold')
if self.if_manual_plot: plt.show()
else: plt.close(fig)
if self.if_save_result: fig.savefig(self.out + fig_names[i] + fig_end)
def __multiple_plot(self):
os.system("mkdir -p " + self.out)
x_name = self.file_column_names[0]
fig = plt.figure()
if self.oname == None:
fig_names = self.var
fig_end = ".png"
else:
fig_names = self.oname
fig_end = ""
for data in self.file_data:
for y_name in self.var:
plt.plot(data.data[x_name], data.data[y_name], linewidth=4)
for i in range(self.fig_count):
y_name = self.var[i]
fig = plt.figure()
for read_data in self.file_data:
plt.plot(read_data.data[x_name], read_data.data[y_name], linewidth=4)
plt.legend(self.filename)
plt.xlabel(x_name, fontsize=10, fontweight='bold')
plt.ylabel(y_name, fontsize=10, fontweight='bold')
if self.if_manual_plot: plt.show()
else: plt.close(fig)
if self.if_save_result: fig.savefig(self.out + self.oname[0])
if self.if_manual_plot: plt.show()
else: plt.close(fig)
if self.if_save_result: fig.savefig(self.out + fig_names[i] + fig_end)
def __get_min_max_ax(self):
min_max_var_vals = {var : [] for var in self.var}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment