# -*- coding: utf-8 -*- """ Created on Mon Nov 11 17:58:41 2024 @author: shen_t2 """ import os os.chdir(os.path.abspath(os.path.dirname(__file__))) import numpy as np import matplotlib.pyplot as plt plt.rcParams.update({'font.size': 14}) # %% MAIN_EXP_folder = 'C:/RE_qubit_TS/202510_T1_pair/' os.chdir(MAIN_EXP_folder) speed_filename_list = ['wl_scan_x_axis_1530.00_1530.50_speed0.0030_CWGatedD_10091925.npy', # 'wl_scan_x_axis_1530.00_1530.50_speed0.0050_CWGatedD_10091858.npy', 'wl_scan_x_axis_1530.00_1530.50_speed0.0075_CWGatedD_10091929.npy', 'wl_scan_x_axis_1530.00_1530.50_speed0.0100_CWGatedD_10091937.npy', # 'wl_scan_x_axis_1530.00_1530.50_speed0.0150_CWGatedD_10091908.npy', 'wl_scan_x_axis_1530.00_1530.50_speed0.0200_CWGatedD_10091939.npy'] # %% single axis plt.figure(101, figsize=[9,6], dpi=100) plt.clf() for ii, speed_filename in enumerate(speed_filename_list): wl_scan_all = np.load(speed_filename) actual_counts = np.load('actual_counts_B0Gs_rep0_'+speed_filename[-12:]) plt.plot(wl_scan_all, actual_counts, '.-', label=speed_filename[-12:-4] ) plt.grid() plt.legend(loc=2) plt.title('Comparison of scan speed \n[0.0030, 0.0075, 0.0100, 0.0200 nm/s]') plt.xlabel('Wavelength (nm)') plt.ylabel('Photon counts (cps)') plt.tight_layout() plt.savefig( MAIN_EXP_folder + '20251009_compare_scan_speed_TTL10ms.jpg' ) plt.show() # %% double axes # fig, ax1 = plt.subplots(num=121, figsize=[9,6], dpi=100) # fig.suptitle('Comparison of CW PLE Gated or not [Bz = +1000 Gs, pi-excitation, OD 3.0]') # color = 'k' # ax1.set_xlabel('Wavelength (nm)') # ax1.set_ylabel('Photon counts (cps)', color=color) # ax1.plot(CWCD_wl_scan_all, CWCD_actual_counts, '-'+color, label='CW_CD, actual' ) # ax1.tick_params(axis='x', direction='in') # ax1.tick_params(axis='y', direction='in', labelcolor=color) # ax2 = ax1.twinx() # color = 'b' # ax2.set_ylabel('', color=color) # ax2.plot(CWGatedD_wl_scan_all, CWGatedD_actual_counts, '-'+color, label='CW_Gated, actual' ) # ax2.tick_params(axis='y', direction='in', labelcolor=color) # ax2.ticklabel_format(axis='y', style='sci', scilimits=(0,0)) # fig.legend(loc=2, bbox_to_anchor=(0.08, 0.88)) # fig.tight_layout() # otherwise the right y-label is slightly clipped # # fig.savefig( MAIN_EXP_folder + '20241111_compare_CW_Gated_actual_dualY.jpg' ) # plt.show()