diff --git a/src/plot.py b/src/plot.py new file mode 100644 index 0000000..c217079 --- /dev/null +++ b/src/plot.py @@ -0,0 +1,45 @@ +import numpy as np +import matplotlib.pyplot as plt +import pandas as pd +import seaborn as sns + +sns.set_theme() +sns.dark_palette("seagreen") + +"""Write to file (for dense matrix): +Line give size of matrix (column give number of transformations until convergence) + N 1 (2 3 4 5) + 3 + 6 + 9 + 12 + 15 +""" + +def read_data(filename: str) -> tuple: + N = [] + T = [] + with open(filename, "r") as f: + lines = f.readlines() + for line in lines: + n_i, t_i = line.strip().split(",") + N.append(float(n_i)) + T.append(float(t_i)) + return (N, T) + + + +def plot_similarity_transformations(N: np.ndarray, T: np.ndarray) -> None: + fig, ax = plt.subplots() + ax.plot(N, T, label='Transformations') + ax.set_xlabel('N') + ax.set_ylabel('Similarity transformations') + ax.set_xlim(xmin=N[0], xmax=N[-1]) + fig.savefig("similarity_transformation.pdf") + +def plot_eigenvectors(): + pass + + +if __name__ == '__main__': + pass \ No newline at end of file