From def88e0cd63c5c2ddd20efcaefba66dba1c8e733 Mon Sep 17 00:00:00 2001 From: guanjihuan Date: Sun, 9 Oct 2022 07:00:40 +0800 Subject: [PATCH] 0.0.141 --- API_Reference.py | 2 +- PyPI/setup.cfg | 2 +- PyPI/src/guan.egg-info/PKG-INFO | 2 +- PyPI/src/guan/__init__.py | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/API_Reference.py b/API_Reference.py index 41bd882..9260d0c 100644 --- a/API_Reference.py +++ b/API_Reference.py @@ -307,7 +307,7 @@ guan.plot_three_array_with_three_horizontal_array(x1_array, x2_array, x3_array, guan.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) -guan.plot_contour(x_array, y_array, matrix, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', file_format='.jpg', dpi=300) +guan.plot_contour(x_array, y_array, matrix, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=15, cmap='jet', levels=None, show=1, save=0, filename='a', file_format='.jpg', dpi=300) guan.draw_dots_and_lines(coordinate_array, draw_dots=1, draw_lines=1, max_distance=1.1, line_style='-k', linewidth=1, dot_style='ro', markersize=3, show=1, save=0, filename='a', file_format='.eps', dpi=300) diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index 24f12ea..bad4809 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = guan -version = 0.0.140 +version = 0.0.141 author = guanjihuan author_email = guanjihuan@163.com description = An open source python package diff --git a/PyPI/src/guan.egg-info/PKG-INFO b/PyPI/src/guan.egg-info/PKG-INFO index b5ec5cb..9f4ec07 100644 --- a/PyPI/src/guan.egg-info/PKG-INFO +++ b/PyPI/src/guan.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: guan -Version: 0.0.140 +Version: 0.0.141 Summary: An open source python package Home-page: https://py.guanjihuan.com Author: guanjihuan diff --git a/PyPI/src/guan/__init__.py b/PyPI/src/guan/__init__.py index a191565..f791829 100644 --- a/PyPI/src/guan/__init__.py +++ b/PyPI/src/guan/__init__.py @@ -2,7 +2,7 @@ # With this package, you can calculate band structures, density of states, quantum transport and topological invariant of tight-binding models by invoking the functions you need. Other frequently used functions are also integrated in this package, such as file reading/writing, figure plotting, data processing. -# The current version is guan-0.0.140, updated on September 30, 2022. +# The current version is guan-0.0.141, updated on December 09, 2022. # Installation: pip install --upgrade guan @@ -2343,18 +2343,18 @@ def plot_3d_surface(x_array, y_array, matrix, xlabel='x', ylabel='y', zlabel='z' plt.show() plt.close('all') -def plot_contour(x_array, y_array, matrix, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=15, show=1, save=0, filename='a', file_format='.jpg', dpi=300): +def plot_contour(x_array, y_array, matrix, xlabel='x', ylabel='y', title='', fontsize=20, labelsize=15, cmap='jet', levels=None, show=1, save=0, filename='a', file_format='.jpg', dpi=300): import matplotlib.pyplot as plt fig, ax = plt.subplots() plt.subplots_adjust(bottom=0.2, right=0.75, left=0.2) x_array, y_array = np.meshgrid(x_array, y_array) - contour = ax.contourf(x_array,y_array,matrix,cmap='jet') + contour = ax.contourf(x_array,y_array,matrix,cmap=cmap, levels=levels) ax.set_title(title, fontsize=fontsize, fontfamily='Times New Roman') ax.set_xlabel(xlabel, fontsize=fontsize, fontfamily='Times New Roman') ax.set_ylabel(ylabel, fontsize=fontsize, fontfamily='Times New Roman') ax.tick_params(labelsize=labelsize) 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] cax = plt.axes([0.8, 0.2, 0.05, 0.68]) cbar = fig.colorbar(contour, cax=cax) cbar.ax.tick_params(labelsize=labelsize)