Skip to content

Commit

Permalink
make the x and y axis labels variable
Browse files Browse the repository at this point in the history
  • Loading branch information
AlyaGomaa committed Mar 27, 2024
1 parent 71559eb commit 61bc60b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 5 additions & 3 deletions plot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
class Plot:
def line(self,
metrics_per_threshold: Dict[int, Dict[str, float]],
title: str
title: str,
x_axis_label: str='Thresholds',
y_axis_label: str='Metrics',
):
"""
Each call to this function results in one graph/plot , each metric in
Expand Down Expand Up @@ -40,8 +42,8 @@ def line(self,


plt.title(title)
plt.xlabel('Thresholds')
plt.ylabel("Metrics")
plt.xlabel(x_axis_label)
plt.ylabel(y_axis_label)
plt.legend()
plt.show()

Expand Down
7 changes: 5 additions & 2 deletions scripts/slips_metrics_getter.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,14 @@ def main():
plot = Plot()
plot.line(
sum_of_confusion_matrix_per_threshold,
"Sum of Errors Over Thresholds"
"Sum of Errors Over Thresholds",
y_axis_label="Errors"
)
plot.line(
error_rates,
"Error Rates Over Thresholds"
"Error Rates Over Thresholds",
y_axis_label="Rates"

)


Expand Down

0 comments on commit 61bc60b

Please sign in to comment.