zoukankan      html  css  js  c++  java
  • matplotlib图中图

    import matplotlib.pyplot as plt
    #method 1
    fig=plt.figure()
    x=[1,2,3,4,5,6,7]
    y=[1,3,4,2,5,8,6]
    #相对于整个figure来说的,形式是百分比
    left,bottom,width,height=[0.1,0.1,0.8,0.8]
    ax1=fig.add_axes([left,bottom,width,height])
    ax1.plot(x,y)
    ax1.set_xlabel('xlabel')
    ax1.set_ylabel('ylabel')
    ax1.set_title('title inside axes')
    left,bottom,width,height=[0.2,0.6,0.25,0.25]
    ax2=fig.add_axes([left,bottom,width,height])
    ax2.plot(y,x)
    ax2.set_xlabel('set label')
    ax2.set_ylabel('set label')
    ax2.set_title("title")
    #method 2,直接使用plot
    plt.axes([0.6,0.16,0.25,0.25])#[left,bottom,width,height]
    plt.plot(x,y,'g')
    plt.xlabel('plot xlabel')
    plt.ylabel('plot ylabel')
    plt.title("title plot")
    #plot这个函数是紧跟着上面的(这个是plot的特性,就近跟着最近的plot)
    plt.show()
  • 相关阅读:
    jq元素拖拽
    路径中取文件名
    HBase相关问题
    HBase数据模型
    HBase安装过程
    HBase物理模型
    Hadoop性能调优
    Hive性能调优
    Hadoop资源调度器
    Hive的执行生命周期
  • 原文地址:https://www.cnblogs.com/shunguo/p/14288393.html
Copyright © 2011-2022 走看看