博客
关于我
画多个图及相关细节总结
阅读量:297 次
发布时间:2019-03-03

本文共 1836 字,大约阅读时间需要 6 分钟。

            fig, (ax1, ax2,ax3) = plt.subplots(3,1, figsize=(15,10),facecolor='white')

            plt.subplots_adjust(hspace=0.5)
            mpf.candlestick_ochl(ax1, k_test_data_values, width=1.0, colorup = 'r', colordown = 'g')
            ax1.set_title(test_code)
            ax1.set_ylabel('Price')
            ax1.grid(True)
            x_list=n_division(len(k_test_data),5)
            ax1.set_xticks(x_list)
            ax1.set_xticklabels(k_test_data.ix[x_list,'str_date'])
            mpf.candlestick_ochl(ax2, find_data_values, width=1.0, colorup = 'r', colordown = 'g')
            ax2.set_title(find_code)
            ax2.set_ylabel('Price')
            ax2.grid(True)
            x2_list=n_division(len(find_data),5)
            ax2.set_xticks(x2_list)
            ax2.set_xticklabels(find_data.ix[x2_list,'str_date'])
            """收盘价数据"""
            two_closes=pd.DataFrame()
            two_closes['test']=k_test_data['dealed_close'].values
            two_closes['find']=find_data['dealed_close'].values
            two_closes.reset_index(drop=True,inplace=True)
            two_closes.plot(ax=ax3)
            ax3.text(cnt//2,0.5,'similarity:'+str(result.ix[find_idx,'ratio']),family='monospace',fontsize=10)
            plt.show()

fig,ax1=plt.subplots(1,figsize=(10,8))

plot_data[[bench_column_name]].plot(c='r',ax=ax1)
plot_data[ref1_columns_name].plot(c='b',ax=ax1)
plot_data[ref2_columns_name[0:3]].plot(c='g',ax=ax1)
plot_data[ref2_columns_name[3:6]].plot(c='y',ax=ax1)
ax1.set_title(bench_mark+'_'+begin_date+'_'+over_date+" similar k lines")
#ax1.set_xticklabels(x_labels)
ax1.set_xlabel('date')
ax1.set_ylabel('net')
fig.savefig('pdf/'+'_new_algo_'+prefix+'_'+bench_mark+'_'+begin_date+'_'+over_date+'.pdf',dpi=1000,bbox_inches='tight')
plt.show()

        import matplotlib.mlab as mlab

        import matplotlib.pyplot as plt
        labels=[u'big_big_down',u'big_down',u'down',u'up',u'big_up',u'big_big_up']
        X=test_result[-1].reshape(-1,).tolist()
        fig = plt.figure()
        plt.pie(X,labels=labels,autopct='%1.2f%%') #画饼图(数据,数据对应的标签,百分数保留两位小数点)
        plt.title(code+'_lstm_prob')
        plt.savefig(code+'_lstm_prob'+'.pdf')
        plt.show()

你可能感兴趣的文章
【Java面试】30个 Java 集合面试必备的问题和答案
查看>>
华为鸿蒙到底是不是安卓系统套了个壳?
查看>>
redis知识点学习
查看>>
多线程之创建线程的两种方式
查看>>
fragment中recyclerview的重新加载问题
查看>>
window程序设计(1):第一个windows程序
查看>>
windows程序设计(4):文本输出
查看>>
21.2.3总结
查看>>
线性代数和数学期望杂题
查看>>
【SSL_P2876】2017年东莞市信息学特长生测试题 工程
查看>>
【洛谷_P1433】吃奶酪
查看>>
赠书和投票 | 你知道中国有哪些Server SAN厂商吗? 投票:你心目最好的HCI品牌是?
查看>>
Base理论介绍
查看>>
volatile关键字和AtomicInteger
查看>>
RedisTemplate中opsForValue()中的方法
查看>>
redisTemplate.opsForHash()
查看>>
循环体内,字符串的连接方式,使用StringBuilder的append方法进行扩展
查看>>
maven生命周期
查看>>
方法的绑定机制-静态绑定和动态绑定
查看>>
内核程序和应用程序
查看>>