diff --git a/academic_codes/2021.01.10_Berry_curvature_distribution_of_graphene_under_broken_inversion_symmery/Berry_curvature_distribution_of_graphene_under_broken_inversion_symmery.py b/academic_codes/2021.01.10_Berry_curvature_distribution_of_graphene_under_broken_inversion_symmery/Berry_curvature_distribution_of_graphene_under_broken_inversion_symmery.py index 3992df8..096ffa7 100755 --- a/academic_codes/2021.01.10_Berry_curvature_distribution_of_graphene_under_broken_inversion_symmery/Berry_curvature_distribution_of_graphene_under_broken_inversion_symmery.py +++ b/academic_codes/2021.01.10_Berry_curvature_distribution_of_graphene_under_broken_inversion_symmery/Berry_curvature_distribution_of_graphene_under_broken_inversion_symmery.py @@ -116,7 +116,7 @@ def find_vector_with_the_same_gauge(vector_1, vector_0): # print('二分查找找到的规范=', phase) return vector_1 -def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', format='jpg', dpi=300, z_min=None, z_max=None, rcount=100, ccount=100): +def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', file_format='.jpg', dpi=300, z_min=None, z_max=None, rcount=100, ccount=100): import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.ticker import LinearLocator @@ -150,7 +150,7 @@ def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z' for l in cbar.ax.yaxis.get_ticklabels(): l.set_family('Times New Roman') if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') diff --git a/academic_codes/2021.04.24_Hofstadter_butterfly_of_graphene_ribbon/Hofstadter_butterfly_of_graphene_ribbon.py b/academic_codes/2021.04.24_Hofstadter_butterfly_of_graphene_ribbon/Hofstadter_butterfly_of_graphene_ribbon.py index a907875..18d0986 100644 --- a/academic_codes/2021.04.24_Hofstadter_butterfly_of_graphene_ribbon/Hofstadter_butterfly_of_graphene_ribbon.py +++ b/academic_codes/2021.04.24_Hofstadter_butterfly_of_graphene_ribbon/Hofstadter_butterfly_of_graphene_ribbon.py @@ -71,7 +71,7 @@ def calculate_eigenvalue_with_one_parameter(x_array, hamiltonian_function, print i0 += 1 return eigenvalue_array -def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', format='jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): +def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', file_format='.jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): import matplotlib.pyplot as plt fig, ax = plt.subplots() plt.subplots_adjust(bottom=adjust_bottom, left=adjust_left) @@ -90,7 +90,7 @@ def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labels labels = ax.get_xticklabels() + ax.get_yticklabels() [label.set_fontname('Times New Roman') for label in labels] if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') diff --git a/academic_codes/2021.07.28_bands_of_SSH_model_with_two_kinds_of_fourier_transform/bands_of_SSH_model_with_two_kinds_of_fourier_transform.py b/academic_codes/2021.07.28_bands_of_SSH_model_with_two_kinds_of_fourier_transform/bands_of_SSH_model_with_two_kinds_of_fourier_transform.py index 8a09446..1e3762e 100644 --- a/academic_codes/2021.07.28_bands_of_SSH_model_with_two_kinds_of_fourier_transform/bands_of_SSH_model_with_two_kinds_of_fourier_transform.py +++ b/academic_codes/2021.07.28_bands_of_SSH_model_with_two_kinds_of_fourier_transform/bands_of_SSH_model_with_two_kinds_of_fourier_transform.py @@ -53,7 +53,7 @@ def calculate_eigenvalue_with_one_parameter(x_array, hamiltonian_function, print i0 += 1 return eigenvalue_array -def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', format='jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): +def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', file_format='.jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): import matplotlib.pyplot as plt fig, ax = plt.subplots() plt.subplots_adjust(bottom=adjust_bottom, left=adjust_left) @@ -72,7 +72,7 @@ def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labels labels = ax.get_xticklabels() + ax.get_yticklabels() [label.set_fontname('Times New Roman') for label in labels] if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') diff --git a/academic_codes/2021.08.09_flat_bands_of_kagome lattice/flat_bands_of_kagome lattice.py b/academic_codes/2021.08.09_flat_bands_of_kagome lattice/flat_bands_of_kagome lattice.py index d577ea7..73421eb 100644 --- a/academic_codes/2021.08.09_flat_bands_of_kagome lattice/flat_bands_of_kagome lattice.py +++ b/academic_codes/2021.08.09_flat_bands_of_kagome lattice/flat_bands_of_kagome lattice.py @@ -60,7 +60,7 @@ def calculate_eigenvalue_with_two_parameters(x_array, y_array, hamiltonian_funct i0 += 1 return eigenvalue_array -def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', format='jpg', dpi=300, z_min=None, z_max=None, rcount=100, ccount=100): +def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', file_format='.jpg', dpi=300, z_min=None, z_max=None, rcount=100, ccount=100): import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.ticker import LinearLocator @@ -94,7 +94,7 @@ def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z' for l in cbar.ax.yaxis.get_ticklabels(): l.set_family('Times New Roman') if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') diff --git a/academic_codes/2021.12.09_nested_Wilson_loop_of_BBH_model/BBH_Wilson_loop.py b/academic_codes/2021.12.09_nested_Wilson_loop_of_BBH_model/BBH_Wilson_loop.py index 921be55..f5ee827 100644 --- a/academic_codes/2021.12.09_nested_Wilson_loop_of_BBH_model/BBH_Wilson_loop.py +++ b/academic_codes/2021.12.09_nested_Wilson_loop_of_BBH_model/BBH_Wilson_loop.py @@ -64,7 +64,7 @@ def main(): # import guan # guan.plot(ky_array, nu_x_array, xlabel='ky', ylabel='nu_x', style='-', y_min=0, y_max=1) -def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', format='jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): +def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', file_format='.jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): import matplotlib.pyplot as plt fig, ax = plt.subplots() plt.subplots_adjust(bottom=adjust_bottom, left=adjust_left) @@ -83,7 +83,7 @@ def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labels labels = ax.get_xticklabels() + ax.get_yticklabels() [label.set_fontname('Times New Roman') for label in labels] if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') diff --git a/academic_codes/2021.12.09_nested_Wilson_loop_of_BBH_model/BBH_bands.py b/academic_codes/2021.12.09_nested_Wilson_loop_of_BBH_model/BBH_bands.py index 0cda1e7..3916c92 100644 --- a/academic_codes/2021.12.09_nested_Wilson_loop_of_BBH_model/BBH_bands.py +++ b/academic_codes/2021.12.09_nested_Wilson_loop_of_BBH_model/BBH_bands.py @@ -96,7 +96,7 @@ def calculate_eigenvalue_with_two_parameters(x_array, y_array, hamiltonian_funct i0 += 1 return eigenvalue_array -def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', format='jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): +def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', file_format='.jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): import matplotlib.pyplot as plt fig, ax = plt.subplots() plt.subplots_adjust(bottom=adjust_bottom, left=adjust_left) @@ -115,12 +115,12 @@ def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labels labels = ax.get_xticklabels() + ax.get_yticklabels() [label.set_fontname('Times New Roman') for label in labels] if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') -def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', format='jpg', dpi=300, z_min=None, z_max=None, rcount=100, ccount=100): +def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', file_format='.jpg', dpi=300, z_min=None, z_max=None, rcount=100, ccount=100): import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.ticker import LinearLocator @@ -154,7 +154,7 @@ def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z' for l in cbar.ax.yaxis.get_ticklabels(): l.set_family('Times New Roman') if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') diff --git a/academic_codes/2021.12.09_nested_Wilson_loop_of_BBH_model/BBH_nested_Wilson_loop.py b/academic_codes/2021.12.09_nested_Wilson_loop_of_BBH_model/BBH_nested_Wilson_loop.py index bbd6d5d..536538d 100644 --- a/academic_codes/2021.12.09_nested_Wilson_loop_of_BBH_model/BBH_nested_Wilson_loop.py +++ b/academic_codes/2021.12.09_nested_Wilson_loop_of_BBH_model/BBH_nested_Wilson_loop.py @@ -174,7 +174,7 @@ def get_nu_y_vector(kx, ky_array): nu_y_vector_2 = eigenvector[:, np.argsort(np.real(nu_y))[1]] return nu_y_vector_1, nu_y_vector_2 -def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', format='jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): +def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', file_format='.jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): import matplotlib.pyplot as plt fig, ax = plt.subplots() plt.subplots_adjust(bottom=adjust_bottom, left=adjust_left) @@ -193,7 +193,7 @@ def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labels labels = ax.get_xticklabels() + ax.get_yticklabels() [label.set_fontname('Times New Roman') for label in labels] if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') diff --git a/academic_codes/2022.08.03_Landau_levels_of_honeycomb_lattice/Landau_levels_of_honeycomb_lattice.py b/academic_codes/2022.08.03_Landau_levels_of_honeycomb_lattice/Landau_levels_of_honeycomb_lattice.py index 10e7709..c343724 100644 --- a/academic_codes/2022.08.03_Landau_levels_of_honeycomb_lattice/Landau_levels_of_honeycomb_lattice.py +++ b/academic_codes/2022.08.03_Landau_levels_of_honeycomb_lattice/Landau_levels_of_honeycomb_lattice.py @@ -95,7 +95,7 @@ def calculate_eigenvalue_with_one_parameter(x_array, hamiltonian_function, print return eigenvalue_array -def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', format='jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): +def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', file_format='.jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): import matplotlib.pyplot as plt fig, ax = plt.subplots() plt.subplots_adjust(bottom=adjust_bottom, left=adjust_left) @@ -114,7 +114,7 @@ def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labels y_max=max(y_array) ax.set_ylim(y_min, y_max) if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') diff --git a/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_Wilson_loop_(function_form).py b/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_Wilson_loop_(function_form).py index bcd5ea1..b882254 100644 --- a/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_Wilson_loop_(function_form).py +++ b/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_Wilson_loop_(function_form).py @@ -85,7 +85,7 @@ def calculate_berry_curvature_with_wilson_loop(hamiltonian_function, k_min=-math return k_array, berry_curvature_array -def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', format='jpg', dpi=300, z_min=None, z_max=None, rcount=100, ccount=100): +def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', file_format='.jpg', dpi=300, z_min=None, z_max=None, rcount=100, ccount=100): import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.ticker import LinearLocator @@ -119,13 +119,13 @@ def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z' for l in cbar.ax.yaxis.get_ticklabels(): l.set_family('Times New Roman') if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') -def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', format='jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): +def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', file_format='.jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): import matplotlib.pyplot as plt fig, ax = plt.subplots() plt.subplots_adjust(bottom=adjust_bottom, left=adjust_left) @@ -144,7 +144,7 @@ def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labels y_max=max(y_array) ax.set_ylim(y_min, y_max) if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') diff --git a/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_Wilson_loop_for_degenerate_case_(function_form).py b/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_Wilson_loop_for_degenerate_case_(function_form).py index 7f53b1d..34e2d44 100644 --- a/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_Wilson_loop_for_degenerate_case_(function_form).py +++ b/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_Wilson_loop_for_degenerate_case_(function_form).py @@ -108,7 +108,7 @@ def calculate_berry_curvature_with_wilson_loop_for_degenerate_case(hamiltonian_f return k_array, berry_curvature_array -def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', format='jpg', dpi=300, z_min=None, z_max=None, rcount=100, ccount=100): +def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', file_format='.jpg', dpi=300, z_min=None, z_max=None, rcount=100, ccount=100): import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.ticker import LinearLocator @@ -142,13 +142,13 @@ def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z' for l in cbar.ax.yaxis.get_ticklabels(): l.set_family('Times New Roman') if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') -def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', format='jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): +def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', file_format='.jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): import matplotlib.pyplot as plt fig, ax = plt.subplots() plt.subplots_adjust(bottom=adjust_bottom, left=adjust_left) @@ -167,7 +167,7 @@ def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labels y_max=max(y_array) ax.set_ylim(y_min, y_max) if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') diff --git a/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_the_efficient_method_(function_form).py b/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_the_efficient_method_(function_form).py index 5ced048..9002431 100644 --- a/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_the_efficient_method_(function_form).py +++ b/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_the_efficient_method_(function_form).py @@ -72,7 +72,7 @@ def calculate_berry_curvature_with_efficient_method(hamiltonian_function, k_min= return k_array, berry_curvature_array -def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', format='jpg', dpi=300, z_min=None, z_max=None, rcount=100, ccount=100): +def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', file_format='.jpg', dpi=300, z_min=None, z_max=None, rcount=100, ccount=100): import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.ticker import LinearLocator @@ -106,13 +106,13 @@ def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z' for l in cbar.ax.yaxis.get_ticklabels(): l.set_family('Times New Roman') if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') -def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', format='jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): +def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', file_format='.jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): import matplotlib.pyplot as plt fig, ax = plt.subplots() plt.subplots_adjust(bottom=adjust_bottom, left=adjust_left) @@ -131,7 +131,7 @@ def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labels y_max=max(y_array) ax.set_ylim(y_min, y_max) if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') diff --git a/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_the_efficient_method_for_degenerate_case_(function_form).py b/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_the_efficient_method_for_degenerate_case_(function_form).py index 1fce9e6..f92097b 100644 --- a/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_the_efficient_method_for_degenerate_case_(function_form).py +++ b/academic_codes/2022.08.13_Berry_curvature_distribution_in_function_form/Berry_curvature_distribution_with_the_efficient_method_for_degenerate_case_(function_form).py @@ -114,7 +114,7 @@ def calculate_berry_curvature_with_efficient_method_for_degenerate_case(hamilton return k_array, berry_curvature_array -def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', format='jpg', dpi=300, z_min=None, z_max=None, rcount=100, ccount=100): +def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', file_format='.jpg', dpi=300, z_min=None, z_max=None, rcount=100, ccount=100): import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.ticker import LinearLocator @@ -148,13 +148,13 @@ def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z' for l in cbar.ax.yaxis.get_ticklabels(): l.set_family('Times New Roman') if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all') -def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', format='jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): +def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=20, show=1, save=0, filename='a', file_format='.jpg', dpi=300, style='', y_min=None, y_max=None, linewidth=None, markersize=None, adjust_bottom=0.2, adjust_left=0.2): import matplotlib.pyplot as plt fig, ax = plt.subplots() plt.subplots_adjust(bottom=adjust_bottom, left=adjust_left) @@ -173,7 +173,7 @@ def plot(x_array, y_array, xlabel='x', ylabel='y', title='', fontsize=20, labels y_max=max(y_array) ax.set_ylim(y_min, y_max) if save == 1: - plt.savefig(filename+'.'+format, dpi=dpi) + plt.savefig(filename+file_format, dpi=dpi) if show == 1: plt.show() plt.close('all')