def main(): xs = np.linspace(0, 1, 20) plt.close('all') fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(cm_to_inch(15), cm_to_inch(5)), sharey=True) gamma = 1 upwards = xs * gamma downwards = xs * -gamma color = tum_color(0) axis = ax1 plot_the_shit(axis, color, downwards, upwards, xs, legend=u'$^{13}$C') axis.set_ylabel(u'$E_Z$ (arb. u.)') gamma = 0.6 upwards = xs * gamma downwards = xs * -gamma color = tum_color(5) axis = ax2 plot_the_shit(axis, color, downwards, upwards, xs, legend=u'$^{14}$N') axis.plot_for_thesis([0, 1], [0, 0], color=color) gamma = -0.4 upwards = xs * gamma downwards = xs * -gamma color = tum_color(2) axis = ax3 plot_the_shit(axis, color, downwards, upwards, xs, legend=u'$^{15}$N') plt.tight_layout() plt.savefig('zeeman_splitting.png', dpi=300)
def main(): ks = np.arange(0, 11, 1) plt.close('all') fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(cm_to_inch(15), cm_to_inch(6))) polarizations = calc_polarization(ks) ax1.plot_for_thesis(ks, polarizations, '.', color=tum_color(0)) ax1.set_xlabel(r'$n$') ax1.set_xticks(ks[::2]) ax1.set_ylabel(r'$ P_n $') ax1.__set_ticks(np.arange(0, 1.1, 0.25)) ax2.plot_for_thesis(ks, percentage_of_polarized_states(polarizations), '.', color=tum_color(0)) ax2.set_xlabel(r'$n$') ax2.set_xticks(ks[::2]) ax2.set_ylabel(r'$ \dfrac{N_0}{N_0 + N_{\pm 1}} $') ax2.__set_ticks(np.arange(0.5, 1.01, 0.1)) plt.tight_layout() plt.savefig('polarization.png', dpi=300)
def plot_and_save_odmr_spectrum(cts_broad, cts_narrow, freqs_broad, freqs_narrow): fig, (ax1, ax2) = plt.subplots(1, 2) fig.set_figheight(cm_to_inch(5.5)) fig.set_figwidth(cm_to_inch(15)) plot_one_axis(ax1, cts_broad, freqs_broad) plot_one_axis(ax2, cts_narrow, freqs_narrow) plt.tight_layout() plt.savefig('pulsed_odmr_spectrum.png', dpi=500)
def plot_and_save_odmr_spectrum(cts, freqs): plt.figure(figsize=(inches.cm_to_inch(15), inches.cm_to_inch(5.5))) plt.plot( freqs * 1e-9, graph_transformation.smooth_array_by_rolling_average(cts, 2) * 1e-3, '.') plt.xlabel('mw frequency (GHz)') plt.ylabel('luminescence (kcts/s)') plt.tight_layout() plt.savefig('cw_odmr_spectrum.png', dpi=500)
def plot(self): plt.figure(figsize=(cm_to_inch(15), cm_to_inch(5.5))) luminescences = self.__load_luminescences() average = np.average(luminescences[:20]) plt.ylabel('luminescence (normalized)') plt.xlabel('time (h)') plt.plot(1.5 * np.array(list(range(len(luminescences)))) / 600, luminescences / average, color=tum_color(0)) plt.tight_layout() plt.savefig('luminescence_fluctuation.png', dpi=500)
def main(): file_data = load_file_data() plt.close('all') plt.figure(figsize=(cm_to_inch(7.5), cm_to_inch(5))) plt.imshow(file_data['result'], vmax=8e4, cmap=tum_jet, interpolation='bilinear', origin='lower', extent=[0, x_extent(file_data), 0, y_extent(file_data)]) plt.xlabel(r'$x$ ($\si{\micro \meter}$)') plt.ylabel(r'$y$ ($\si{\micro \meter}$)') plt.yticks([0, 10, 20]) cbar = plt.colorbar(aspect=10) cbar.ax.set_yticklabels(['20', '40', '60', '80']) cbar.set_label(r'luminescence (kcts/s)') plt.tight_layout() plt.savefig('confocal_scan.png', dpi=500)
def plot_t1(): xs = np.linspace(0, 3, 100) ys = np.exp(-xs) plt.close('all') plt.figure(figsize=(inch.cm_to_inch(7.5), inch.cm_to_inch(5))) plt.plot(xs, ys, color=tum.tum_color(0)) plt.ylim((-0.1, 1.1)) plt.yticks([0, 1], [ r'$\braket{\boldsymbol{\mu}_0}_z$', r'$\left| \braket{\boldsymbol{\mu}_S} \right|$' ]) plt.ylabel(r'$z$-component') plt.xlabel('time (arb.u.)') plt.tight_layout() plt.savefig('t1_decay.png', dpi=300)
def plot_t2(): xs = np.linspace(0, 3, 1000) damping = 0.4 ys = np.exp(-xs * damping) * np.cos(10 * xs) upper_envelope = np.exp(-xs * damping) lower_envelope = -np.exp(-xs * damping) plt.close('all') plt.figure(figsize=(inch.cm_to_inch(7.5), inch.cm_to_inch(5))) plt.plot(xs, ys, color=tum.tum_color(0)) alpha = 0.4 plt.plot(xs, upper_envelope, '--', color=tum.tum_color(0), alpha=alpha) plt.plot(xs, lower_envelope, '--', color=tum.tum_color(0), alpha=alpha) plt.ylim((-1.1, 1.1)) plt.yticks([-1, 0, 1], [ r'$-\left| \braket{\boldsymbol{\mu}_S} \right|$', 0, r'$\left| \braket{\boldsymbol{\mu}_S} \right|$' ]) plt.ylabel(r'$y$-component') plt.xlabel('time (arb.u.)') plt.tight_layout() plt.savefig('t2_decay.png', dpi=300)
def __create_and_scale_figure_and_axes(self): self.fig, self.axes = plt.subplots(nrows=2, ncols=2) self.fig.set_figheight(cm_to_inch(15)) self.fig.set_figwidth(cm_to_inch(15))
def __init__(self): plt.rcParams['text.latex.preamble'] = [r"\usepackage{siunitx}"] self.data = load_echo_data() self.fig = plt.figure(figsize=(cm_to_inch(15), cm_to_inch(6.5)))
def create_figure_with_two_axes(): fig, (ax1, ax2) = plt.subplots(1, 2) fig.set_figheight(cm_to_inch(5.5)) fig.set_figwidth(cm_to_inch(15)) return fig, ax1, ax2
def __init__(self): self.path = "//file/e24/Projects/ReinhardLab/data_setup_nv1/180704_hf_setup_deer_tests" self.fig = plt.figure(figsize=(cm_to_inch(15), cm_to_inch(6.5))) self.slow_rabis = self.load_file('pulsed.000.mat') self.fast_rabis = self.load_file('pulsed.001.mat')