-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpair_plot.py
More file actions
38 lines (29 loc) · 1.09 KB
/
pair_plot.py
File metadata and controls
38 lines (29 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import argparse
import matplotlib.pyplot as pyplot
import seaborn
from data_preprocessing import create_dataframe
from variables import colors, labels_column
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="A simple python program to print the pait plot of a given csv dataset")
parser.add_argument("filename", help="the dataset csv file")
parser.add_argument("--web", action="store_true", help="does not hang program to display plots")
args = parser.parse_args()
pyplot.style.use("gruvbox.mplstyle")
seaborn.set_theme(style="dark")
dataset = create_dataframe(args.filename)
features = dataset.select_dtypes(include=["float64"]).columns.tolist()
features.sort()
splot = seaborn.pairplot(
dataset,
vars=features,
hue=labels_column,
palette=colors,
diag_kind="hist",
plot_kws=dict(marker=".", alpha=0.8, sizes=5),
)
filename = "static/Image/pair/pairplot.png"
splot.savefig(filename)
print(f"created {filename}")
if args.web is False:
pyplot.show()
pyplot.close()