Skip to content

Commit

Permalink
Updated plot functions in heatmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
hprats committed Feb 9, 2025
1 parent 433dfec commit ef94545
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion zacrostools/heatmaps/plot_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,6 @@ def plot_coverage(
)

if show_points:
ax.plot(x_axis.flatten(), y_axis.flatten(), 'k.', markersize=3)
ax.plot(x_axis.flatten(), y_axis.flatten(), 'w.', markersize=3)

return cp
15 changes: 13 additions & 2 deletions zacrostools/heatmaps/plot_dtof.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from zacrostools.kmc_output import KMCOutput
from zacrostools.custom_exceptions import PlotError
from zacrostools.heatmaps.heatmap_functions import get_axis_label, convert_to_subscript
from zacrostools.heatmaps.heatmap_functions import get_axis_label, extract_value, convert_to_subscript


def plot_dtof(
Expand Down Expand Up @@ -103,6 +103,17 @@ def plot_dtof(
folder_name = os.path.basename(sim_path)
ref_path = os.path.join(scan_path_ref, folder_name)

# Extract x and y values
x_value = extract_value(x, sim_path)
y_value = extract_value(y, sim_path)
df.loc[folder_name, "x_value"] = x_value
df.loc[folder_name, "y_value"] = y_value
if x_value not in x_value_list:
x_value_list.append(x_value)
if y_value not in y_value_list:
y_value_list.append(y_value)

# Initialize KMCOutputs and retrieve TOF and total production for the given gas_spec
try:
kmc_output = KMCOutput(
path=sim_path,
Expand Down Expand Up @@ -203,6 +214,6 @@ def plot_dtof(
)

if show_points:
ax.plot(x_axis.flatten(), y_axis.flatten(), 'k.', markersize=3)
ax.plot(x_axis.flatten(), y_axis.flatten(), 'w.', markersize=3)

return cp
2 changes: 1 addition & 1 deletion zacrostools/heatmaps/plot_energyslope.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def plot_energyslope(
)

if show_points:
ax.plot(x_axis.flatten(), y_axis.flatten(), 'k.', markersize=3)
ax.plot(x_axis.flatten(), y_axis.flatten(), 'w.', markersize=3)

return cp

2 changes: 1 addition & 1 deletion zacrostools/heatmaps/plot_finaltime.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,6 @@ def plot_finaltime(
)

if show_points:
ax.plot(x_axis.flatten(), y_axis.flatten(), 'k.', markersize=3)
ax.plot(x_axis.flatten(), y_axis.flatten(), 'w.', markersize=3)

return cp
2 changes: 1 addition & 1 deletion zacrostools/heatmaps/plot_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,6 @@ def plot_issues(
)

if show_points:
ax.plot(x_axis.flatten(), y_axis.flatten(), 'k.', markersize=3)
ax.plot(x_axis.flatten(), y_axis.flatten(), 'w.', markersize=3)

return cp
2 changes: 1 addition & 1 deletion zacrostools/heatmaps/plot_phasediagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,6 @@ def plot_phasediagram(
)

if show_points:
ax.plot(x_axis.flatten(), y_axis.flatten(), 'k.', markersize=3)
ax.plot(x_axis.flatten(), y_axis.flatten(), 'w.', markersize=3)

return cp
2 changes: 1 addition & 1 deletion zacrostools/heatmaps/plot_selectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,6 @@ def plot_selectivity(
)

if show_points:
ax.plot(x_axis.flatten(), y_axis.flatten(), 'k.', markersize=3)
ax.plot(x_axis.flatten(), y_axis.flatten(), 'w.', markersize=3)

return cp
2 changes: 1 addition & 1 deletion zacrostools/heatmaps/plot_tof.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,6 @@ def plot_tof(
)

if show_points:
ax.plot(x_axis.flatten(), y_axis.flatten(), 'k.', markersize=3)
ax.plot(x_axis.flatten(), y_axis.flatten(), 'w.', markersize=3)

return cp

0 comments on commit ef94545

Please sign in to comment.