Skip to content

Commit

Permalink
removing commented code lines in plot.py (#75)
Browse files Browse the repository at this point in the history
Co-authored-by: Rahul Kikkeri Nagaraja <[email protected]>
  • Loading branch information
RahulKikkeriNagaraja and Rahul Kikkeri Nagaraja authored Oct 7, 2020
1 parent 8201e7e commit d7a2770
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 82 deletions.
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
from matplotlib.ticker import TickHelper
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker

plt.style.use('seaborn')

history = "Optimization_Results_3.0"
history = "Optimization_Results"

plot = {
"name": "strain energy",
"column_name": "f"
}


path = f"{history}/optimization_log.csv"

df = pd.read_csv(path, delimiter=",")
df.columns = [x.strip() for x in df.columns]

"""
fig, axs = plt.subplots(1, len(plots), figsize=(18, 6))
for plot, ax in zip(plots, axs):
for column_name in plot["column_names"]:
ax.plot(df[column_name], label=column_name)
ax.legend()
ax.set_title(plot["name"])
"""

fig, ax = plt.subplots(1, 1, figsize=(4, 6))
ax.plot(df[plot["column_name"]], label=plot["column_name"])
ax.legend(fontsize=11)
Expand All @@ -36,23 +25,4 @@
ax.yaxis.set_major_locator(ticker.MultipleLocator(0.5)) # tick_spacing
ax.xaxis.set_major_locator(ticker.MultipleLocator(10)) # tick_spacing

"""grid = plt.GridSpec(2, 3)
plot_f = plt.subplot(grid[:, 0])
plot_c1 = plt.subplot(grid[0, 1])
plot_c2 = plt.subplot(grid[0, 2])
plot_c3 = plt.subplot(grid[1, 1])
plot_stp = plt.subplot(grid[1, 2])
axs_list = [plot_f, plot_c1, plot_c2, plot_c3, plot_stp]
for plot, ax in zip(plots, axs_list):
for column_name in plot["column_names"]:
ax.plot(df[column_name], label=column_name)
ax.legend(fontsize=11)
ax.set_title(plot["name"], fontsize=13)
ax.tick_params(axis='x', labelsize=13)
ax.tick_params(axis='y', labelsize=13)
ax.xaxis.set_major_locator(ticker.MultipleLocator(4)) # tick_spacing is 4
if plot['name'] == 'mass':
ax.yaxis.set_major_locator(ticker.MultipleLocator(1))
plt.tight_layout()
"""
plt.show()
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from matplotlib.ticker import TickHelper
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
Expand All @@ -11,22 +10,11 @@
"column_name": "f"
}


path = f"{history}/optimization_log.csv"

df = pd.read_csv(path, delimiter=",")
df.columns = [x.strip() for x in df.columns]

"""
fig, axs = plt.subplots(1, len(plots), figsize=(18, 6))
for plot, ax in zip(plots, axs):
for column_name in plot["column_names"]:
ax.plot(df[column_name], label=column_name)
ax.legend()
ax.set_title(plot["name"])
"""

fig, ax = plt.subplots(1, 1, figsize=(4, 6))
ax.plot(df[plot["column_name"]], label=plot["column_name"])
ax.legend(fontsize=11)
Expand All @@ -36,23 +24,4 @@
ax.yaxis.set_major_locator(ticker.MultipleLocator(0.001)) # tick_spacing
ax.xaxis.set_major_locator(ticker.MultipleLocator(10)) # tick_spacing

"""grid = plt.GridSpec(2, 3)
plot_f = plt.subplot(grid[:, 0])
plot_c1 = plt.subplot(grid[0, 1])
plot_c2 = plt.subplot(grid[0, 2])
plot_c3 = plt.subplot(grid[1, 1])
plot_stp = plt.subplot(grid[1, 2])
axs_list = [plot_f, plot_c1, plot_c2, plot_c3, plot_stp]
for plot, ax in zip(plots, axs_list):
for column_name in plot["column_names"]:
ax.plot(df[column_name], label=column_name)
ax.legend(fontsize=11)
ax.set_title(plot["name"], fontsize=13)
ax.tick_params(axis='x', labelsize=13)
ax.tick_params(axis='y', labelsize=13)
ax.xaxis.set_major_locator(ticker.MultipleLocator(4)) # tick_spacing is 4
if plot['name'] == 'mass':
ax.yaxis.set_major_locator(ticker.MultipleLocator(1))
plt.tight_layout()
"""
plt.show()
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from matplotlib.ticker import TickHelper
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
Expand Down Expand Up @@ -49,24 +48,6 @@
df = pd.read_csv(path, delimiter=",")
df.columns = [x.strip() for x in df.columns]

"""
fig, axs = plt.subplots(1, len(plots), figsize=(18, 6))
for plot, ax in zip(plots, axs):
for column_name in plot["column_names"]:
ax.plot(df[column_name], label=column_name)
ax.legend()
ax.set_title(plot["name"])
fig, axs = plt.subplots(2, 3)
axs_list = [axs[0][0], axs[0][1], axs[0][2], axs[1][0], axs[1][1]]
for plot, ax in zip(plots, axs_list):
for column_name in plot["column_names"]:
ax.plot(df[column_name], label=column_name)
ax.legend()
ax.set_title(plot["name"])"""

grid = plt.GridSpec(2, 3)
plot_f = plt.subplot(grid[:, 0])
plot_c1 = plt.subplot(grid[0, 1])
Expand Down

0 comments on commit d7a2770

Please sign in to comment.