#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun  5 16:06:20 2026

@author: leonhardtm
"""

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pathlib import Path

plt.rcParams['axes.labelsize']=20 
N=np.array([100,150,200,300,400,500,700,1000,1500,2000,3000,5000,10000,20000])
fig,axs=plt.subplots(1,2,figsize=(12,5))
plt.rcParams['axes.labelsize']=20
axs[0].tick_params(direction='out',labelsize=20)
axs[1].tick_params(direction='out',labelsize=20)
cmap = plt.colormaps['gist_rainbow'] 
colors = cmap(np.linspace(0.1, 0.9, len(N)))

for i in range(len(N)):
    n=N[i]
    X=pd.read_csv(Path(__file__).resolve().parent.parent/"DATA"/"FIG7"/'Variance_{}.csv'.format(n))
    X_data=X.to_numpy()

    axs[0].plot(X_data[:,0], X_data[:,1], label="{}".format(n),color=colors[i])
    axs[1].plot(X_data[:,0],X_data[:,2], label="{}".format(n),color=colors[i])


   
plt.setp(axs[0], xlabel=r'$t(\omega_C^{-1})$')
plt.setp(axs[1], xlabel=r'$t(\omega_C^{-1})$')
plt.setp(axs[0], ylabel=r'$Var(s)$')
plt.setp(axs[1], ylabel=r'$NVar(s)$')
axs[0].legend(ncols=7,loc='lower left',title=r'Emitters per Cluster $(N)$',fontsize=20,title_fontsize=20)






