This commit is contained in:
guanjihuan 2021-12-19 15:54:08 +08:00
parent de472b9df5
commit 8a3234ba03
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
[metadata] [metadata]
# replace with your username: # replace with your username:
name = guan name = guan
version = 0.0.32 version = 0.0.33
author = guanjihuan author = guanjihuan
author_email = guanjihuan@163.com author_email = guanjihuan@163.com
description = An open source python package description = An open source python package

View File

@ -23,7 +23,7 @@ def plot(x_array, y_array, xlabel='x', ylabel='y', title='', filename='a', show=
labels = ax.get_xticklabels() + ax.get_yticklabels() labels = ax.get_xticklabels() + ax.get_yticklabels()
[label.set_fontname('Times New Roman') for label in labels] [label.set_fontname('Times New Roman') for label in labels]
if save == 1: if save == 1:
plt.savefig(filename+format, dpi=dpi) plt.savefig(filename+'.'+format, dpi=dpi)
if show == 1: if show == 1:
plt.show() plt.show()
plt.close('all') plt.close('all')
@ -62,7 +62,7 @@ def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z'
for l in cbar.ax.yaxis.get_ticklabels(): for l in cbar.ax.yaxis.get_ticklabels():
l.set_family('Times New Roman') l.set_family('Times New Roman')
if save == 1: if save == 1:
plt.savefig(filename+format, dpi=dpi) plt.savefig(filename+'.'+format, dpi=dpi)
if show == 1: if show == 1:
plt.show() plt.show()
plt.close('all') plt.close('all')
@ -85,7 +85,7 @@ def plot_contour(x_array, y_array, matrix, xlabel='x', ylabel='y', title='', fil
for l in cbar.ax.yaxis.get_ticklabels(): for l in cbar.ax.yaxis.get_ticklabels():
l.set_family('Times New Roman') l.set_family('Times New Roman')
if save == 1: if save == 1:
plt.savefig(filename+format, dpi=dpi) plt.savefig(filename+'.'+format, dpi=dpi)
if show == 1: if show == 1:
plt.show() plt.show()
plt.close('all') plt.close('all')