zoukankan      html  css  js  c++  java
  • 项目 数据可视化3

    2018-04-23 
     1 import matplotlib.pyplot as plt
     2 
     3 x_values=list(range(1,1001))
     4 y_values=[x**2 for x in x_values]
     5 
     6 plt.scatter(x_values,y_values,c=y_values,cmap=plt.cm.Blues,edgecolor='none',s=40)
     7 # 设置图表标题,并给坐标轴加上标签
     8 plt.title("Squares Numbers",fontsize=24)
     9 plt.xlabel("Value",fontsize=14)
    10 plt.ylabel("Square of Value",fontsize=14)
    11 
    12 plt.axis([0,1100,0,1100000])
    13 
    14 plt.show()

     1 import matplotlib.pyplot as plt
     2 
     3 x_values=list(range(1,6))
     4 y_values=[x**3 for x in x_values]
     5 
     6 plt.scatter(x_values,y_values,s=40)
     7 # 设置图表标题,并给坐标轴加上标签
     8 plt.title("cube Numbers",fontsize=24)
     9 plt.xlabel("Value",fontsize=14)
    10 plt.ylabel("cube of Value",fontsize=14)
    11 
    12 plt.axis([0,6,0,140])
    13 
    14 plt.show()

    import matplotlib.pyplot as plt

    x_values=list(range(1,5001))
    y_values=[x**3 for x in x_values]

    plt.scatter(x_values,y_values,s=40)
    # 设置图表标题,并给坐标轴加上标签
    plt.title("cube Numbers",fontsize=24)
    plt.xlabel("Value",fontsize=14)
    plt.ylabel("cube of Value",fontsize=14)

    plt.axis([0,5001,0,5001**3])

    plt.show()

    import matplotlib.pyplot as plt

    x_values=list(range(1,5001))
    y_values=[x**3 for x in x_values]

    plt.scatter(x_values,y_values,c=y_values, cmap=plt.cm.Blues,s=40)
    # 设置图表标题,并给坐标轴加上标签
    plt.title("cube Numbers",fontsize=24)
    plt.xlabel("Value",fontsize=14)
    plt.ylabel("cube of Value",fontsize=14)

    plt.axis([0,5001,0,5001**3])

    plt.show()

     

    2018-04-23     20:08:44

  • 相关阅读:
    Linux NFS服务器的安装与配置
    Genymotion加速下载虚拟镜像速度慢失败Connection timeout
    人脸识别的损失函数
    caffe服务器搭建血泪记录
    shell
    ZigZag Conversion
    SSH阅读笔记
    numpy数组扩展函数repeat和tile用法
    高效网络小结
    Bag of Tricks for Image Classification with Convolutional Neural Networks论文笔记
  • 原文地址:https://www.cnblogs.com/zhulvbo/p/8921484.html
Copyright © 2011-2022 走看看