file_format

This commit is contained in:
2022-09-12 04:53:36 +08:00
parent 4ef5ea4f73
commit 1d29ee5e29
12 changed files with 34 additions and 34 deletions

View File

@@ -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')