From 2dfd4805cbbb27700a2191dc42267b813eeee6f0 Mon Sep 17 00:00:00 2001 From: guanjihuan Date: Thu, 7 Mar 2024 04:56:27 +0800 Subject: [PATCH] 0.1.88 --- PyPI/setup.cfg | 2 +- PyPI/src/guan.egg-info/PKG-INFO | 2 +- PyPI/src/guan/others.py | 13 +++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index aaf11eb..02e1135 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = guan -version = 0.1.87 +version = 0.1.88 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 d34282a..dba5f23 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.1.87 +Version: 0.1.88 Summary: An open source python package Home-page: https://py.guanjihuan.com Author: guanjihuan diff --git a/PyPI/src/guan/others.py b/PyPI/src/guan/others.py index 8fd12be..7d98e1b 100644 --- a/PyPI/src/guan/others.py +++ b/PyPI/src/guan/others.py @@ -357,12 +357,17 @@ def history_data_of_one_stock(symbol='000002', period='daily', start_date="19000 return title, stock_data # 绘制股票图 -def plot_stock_line(date_array, opening_array, closing_array, high_array, low_array, lw_open_close=6, lw_high_low=2, xlabel='date', ylabel='price', title='', fontsize=20, labelsize=20, adjust_bottom=0.2, adjust_left=0.2): +def plot_stock_line(date_array, opening_array, closing_array, high_array, low_array, lw_open_close=6, lw_high_low=2, xlabel='date', ylabel='price', title='', fontsize=20, labelsize=20, adjust_bottom=0.2, adjust_left=0.2, fontfamily='Times New Roman'): import guan plt, fig, ax = guan.import_plt_and_start_fig_ax(adjust_bottom=adjust_bottom, adjust_left=adjust_left, labelsize=labelsize) - 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') + if fontfamily=='Times New Roman': + 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') + else: + ax.set_title(title, fontsize=fontsize) + ax.set_xlabel(xlabel, fontsize=fontsize) + ax.set_ylabel(ylabel, fontsize=fontsize) for i0 in range(len(date_array)): if opening_array[i0] <= closing_array[i0]: ax.vlines(date_array[i0], opening_array[i0], closing_array[i0], linestyle='-', color='red', lw=lw_open_close)