Skip to content

Commit a1b2dd2

Browse files
committed
Make graph better
1 parent 7a9c3a0 commit a1b2dd2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/graph.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import matplotlib.pyplot as plt
44
import pandas
5+
from typing import Dict
56

67
parser = argparse.ArgumentParser(
78
description="Generate a graph with the execution times of the MPI/OMP MinHash implementations."
@@ -34,7 +35,8 @@
3435

3536

3637
def draw_graph(
37-
dists: dict[str, pandas.DataFrame],
38+
dists: Dict[str, pandas.DataFrame],
39+
3840
x_label: str,
3941
y_label: str,
4042
title: str = None,
@@ -54,9 +56,13 @@ def draw_graph(
5456
# Create a new figure
5557
plt.figure()
5658

59+
# Add Style
60+
plt.style.use('classic')
61+
5762
# Plot the data
5863
for name, df in dists.items():
59-
plt.plot(df[x_label], df[y_label], label=name)
64+
plt.plot(df[x_label], df[y_label], label=name, marker='o', markersize=3)
65+
6066

6167
# Add labels
6268
plt.title(title)
@@ -66,6 +72,12 @@ def draw_graph(
6672
# Increase the size of the plot
6773
plt.gcf().set_size_inches(10, 5)
6874

75+
# Add legend
76+
plt.legend()
77+
78+
# Add Grid
79+
plt.grid()
80+
6981
# Save the plot
7082
if save_path:
7183
plt.savefig(save_path)

0 commit comments

Comments
 (0)