diff --git a/API_reference.py b/API_reference.py index d442e8e..f536154 100644 --- a/API_reference.py +++ b/API_reference.py @@ -108,7 +108,7 @@ guan.write_two_dimensional_data(x_array, y_array, matrix, filename='a') # plot figures # Source code: https://py.guanjihuan.com/plot_figures guan.plot(x_array, y_array, xlabel='x', ylabel='y', title='', filename='a', show=1, save=0, format='jpg', dpi=300, type='', y_min=None, y_max=None, linewidth=None, markersize=None) -guan.plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', filename='a', show=1, save=0, format='jpg', dpi=300, z_min=None, z_max=None) +guan.plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', filename='a', show=1, save=0, format='jpg', dpi=300, z_min=None, z_max=None, rcount=100, ccount=100) guan.plot_contour(x_array, y_array, matrix, xlabel='x', ylabel='y', title='', filename='a', show=1, save=0, format='jpg', dpi=300) # others # Source code: https://py.guanjihuan.com/source-code/others diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index bf6e288..72137ac 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = guan -version = 0.0.34 +version = 0.0.35 author = guanjihuan author_email = guanjihuan@163.com description = An open source python package diff --git a/PyPI/src/guan/plot_figures.py b/PyPI/src/guan/plot_figures.py index 0d54bcb..ef7b2cf 100644 --- a/PyPI/src/guan/plot_figures.py +++ b/PyPI/src/guan/plot_figures.py @@ -28,7 +28,7 @@ def plot(x_array, y_array, xlabel='x', ylabel='y', title='', filename='a', show= plt.show() plt.close('all') -def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', filename='a', show=1, save=0, format='jpg', dpi=300, z_min=None, z_max=None): +def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z', title='', filename='a', show=1, save=0, 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 @@ -37,10 +37,10 @@ def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z' plt.subplots_adjust(bottom=0.1, right=0.65) x_array, y_array = np.meshgrid(x_array, y_array) if len(matrix.shape) == 2: - surf = ax.plot_surface(x_array, y_array, matrix, cmap=cm.coolwarm, linewidth=0, antialiased=False) + surf = ax.plot_surface(x_array, y_array, matrix, rcount=rcount, ccount=ccount, cmap=cm.coolwarm, linewidth=0, antialiased=False) elif len(matrix.shape) == 3: for i0 in range(matrix.shape[2]): - surf = ax.plot_surface(x_array, y_array, matrix[:,:,i0], cmap=cm.coolwarm, linewidth=0, antialiased=False) + surf = ax.plot_surface(x_array, y_array, matrix[:,:,i0], rcount=rcount, ccount=ccount, cmap=cm.coolwarm, linewidth=0, antialiased=False) ax.set_title(title, fontsize=20, fontfamily='Times New Roman') ax.set_xlabel(xlabel, fontsize=20, fontfamily='Times New Roman') ax.set_ylabel(ylabel, fontsize=20, fontfamily='Times New Roman')