ax1.spines['bottom'].set_color("#5998ff") ax1.spines['top'].set_color("#5998ff") ax1.spines['left'].set_color("#5998ff") ax1.spines['right'].set_color("#5998ff") #设置y轴刻度值的颜色 ax1.tick_params(axis='y', colors='w') plt.gca().yaxis.set_major_locator(mticker.MaxNLocator(prune='upper')) ax1.tick_params(axis='x', colors='w') plt.ylabel('Stock price and Volume') plt.rcParams['font.sans-serif'] = ['SimHei'] plt.suptitle("股票代码:{}".format(ts_code), color='w', fontsize=40) plt.show() print(stock_data) if __name__ == "__main__": #股票代码 ts_code = "000001.SZ" #对比结果 result = { 'start_time': '20160412', 'end_time': '20160707', 'pearson_index': 0.945269566803306 } read_data = ReadData() source_data = read_data.mysql_read_date(ts_code, result["start_time"], result["end_time"]) k_plot = KLinePlot() k_plot.plot_k_line(source_data, ts_code)