精华内容
下载资源
问答
  • 易语言画板画折线源码,画板画折线,子程序_画折线图直线,子程序_月份,子程序_设置折线,子程序_画折线
  • 易语言源码易语言画板画折线源码.rar 易语言源码易语言画板画折线源码.rar 易语言源码易语言画板画折线源码.rar 易语言源码易语言画板画折线源码.rar 易语言源码易语言画板画折线源码.rar 易语言源码易语言画板...
  • 用MFC实现了运行某算法(pso)得到一系列二维坐标点折线图和读入txt的点进行绘图,并且可以比较折线,而且可以分析读入数据和运行数据的差别出参数表格。环境是vs2012。
  • 资源介绍:易语言画板画折线源码,通过画板实现画折线功能。资源作者:
  • android path画折线

    2016-07-05 10:32:24
    android path 画折线(目前没有动画,有时间后续会加上)
  • 安卓 画折线

    2016-03-20 06:06:50
    安卓 画折线 引用:http://blog.csdn.net/csdnfml/article/details/49669513
    安卓 画折线 引用:http://blog.csdn.net/csdnfml/article/details/49669513
    
    展开全文
  • // 炫酷渐变色背景粒子线条折线连接canvas动画 export const canvas = (val) => { var requestAnimationFrame = window.requestAnimationFrame || function (callback) { window.setTimeout(callback, ...

    博客地址:http://www.globm.top/blog/1/detail/34
    效果图:
    在这里插入图片描述
    1.新建canvas.js

    
    // 炫酷渐变色背景粒子线条折线连接canvas动画
    export const canvas = (val) => {
      var requestAnimationFrame = window.requestAnimationFrame || function (callback) {
        window.setTimeout(callback, 1000 / 60)
      }
    
      // var canvas = document.getElementsByTagName("canvas")[0];
      let canvas = val
      let ctx = canvas.getContext('2d')
      let maximumPossibleDistance
      let mousePositionX
      let mousePositionY
      let mouseElement
      let lines = 0
      let objects = []
      var initAnimation = function () {
        canvas.width = window.innerWidth
        canvas.height = window.innerHeight
        maximumPossibleDistance = Math.round(Math.sqrt((canvas.width * canvas.width) + (canvas.height * canvas.height)))
        Math.floor(canvas.width / 2)
        Math.floor(canvas.height / 2)
        objects.length = 0
        clearCanvas()
        createParticles()
      }
      window.addEventListener('resize', function () { initAnimation() }, false)
      // 线条参数配置
      var options = {
        // 初始线条数量
        particlesNumber: 80,
        // 圆点大小
        initialSize: 3,
        moveLimit: 50,
        durationMin: 50,
        durationMax: 300,
        drawConnections: true,
        mouseInteractionDistance: 150,
        mouseGravity: true,
        drawMouseConnections: true,
        // 图标色彩
        red: 25,
        green: 200,
        blue: 255,
        opacity: 1,
        // 已连接线条
        connectionRed: 255,
        connectionGreen: 255,
        connectionBlue: 255,
        connectionOpacity: 0.2,
        // 鼠标移动线条
        mouseConnectionRed: 255,
        mouseConnectionGreen: 255,
        mouseConnectionBlue: 255,
        mouseConnectionOpacity: 0.2
    
      }
      var getRandomBetween = function (a, b) {
        return Math.floor(Math.random() * b) + a
      }
      var getDistance = function (element1, element2) {
        var difX = Math.round(Math.abs(element1.positionX - element2.positionX))
        var difY = Math.round(Math.abs(element1.positionY - element2.positionY))
    
        return Math.round(Math.sqrt((difX * difX) + (difY * difY)))
      }
      function Particle (positionX, positionY, size, red, green, blue, opacity) {
        this.positionX = positionX
        this.positionY = positionY
        this.size = size
    
        this.duration = getRandomBetween(options.durationMin, options.durationMax)
        this.limit = options.moveLimit
        this.timer = 0
    
        this.red = red
        this.green = green
        this.blue = blue
        this.opacity = opacity
    
        this.color = 'rgba(' + this.red + ',' + this.green + ',' + this.blue + ',+' + this.opacity + ')'
      }
      function MouseParticle (positionX, positionY, size, red, green, blue, opacity) {
        this.positionX = mousePositionX
        this.positionY = mousePositionY
        this.size = size
    
        this.red = red
        this.green = green
        this.blue = blue
        this.opacity = opacity
    
        this.color = 'rgba(' + this.red + ',' + this.green + ',' + this.blue + ',+' + this.opacity + ')'
      }
      Particle.prototype.animateTo = function (newX, newY) {
        var duration = this.duration
    
        var animatePosition = function (newPosition, currentPosition) {
          if (newPosition > currentPosition) {
            var step = (newPosition - currentPosition) / duration
            newPosition = currentPosition + step
          } else {
            step = (currentPosition - newPosition) / duration
            newPosition = currentPosition - step
          }
    
          return newPosition
        }
    
        this.positionX = animatePosition(newX, this.positionX)
        this.positionY = animatePosition(newY, this.positionY)
    
        // generate new vector
    
        if (this.timer === this.duration) {
          this.calculateVector()
          this.timer = 0
        } else {
          this.timer++
        }
      }
      Particle.prototype.updateColor = function () {
        this.color = 'rgba(' + this.red + ',' + this.green + ',' + this.blue + ',+' + this.opacity + ')'
      }
      Particle.prototype.calculateVector = function () {
        var distance
        var newPosition = {}
        var particle = this
    
        var getCoordinates = function () {
          newPosition.positionX = getRandomBetween(0, window.innerWidth)
          newPosition.positionY = getRandomBetween(0, window.innerHeight)
    
          distance = getDistance(particle, newPosition)
        }
    
        // eslint-disable-next-line no-unmodified-loop-condition
        while ((typeof distance === 'undefined') || (distance > this.limit)) {
          getCoordinates()
        }
    
        this.vectorX = newPosition.positionX
        this.vectorY = newPosition.positionY
      }
      Particle.prototype.testInteraction = function () {
        if (!options.drawConnections) return
        var closestElement
        var distanceToClosestElement = maximumPossibleDistance
        for (var x = 0; x < objects.length; x++) {
          var testedObject = objects[x]
          var distance = getDistance(this, testedObject)
          if ((distance < distanceToClosestElement) && (testedObject !== this)) {
            distanceToClosestElement = distance
            closestElement = testedObject
          }
        }
        if (closestElement) {
          ctx.beginPath()
          ctx.moveTo(this.positionX + this.size / 2, this.positionY + this.size / 2)
          ctx.lineTo(closestElement.positionX + closestElement.size * 0.5, closestElement.positionY + closestElement.size * 0.5)
          ctx.strokeStyle = 'rgba(' + options.connectionRed + ',' + options.connectionGreen + ',' + options.connectionBlue + ',' + options.connectionOpacity + ')'
          ctx.stroke()
          lines++
        }
      }
      MouseParticle.prototype.testInteraction = function () {
        if (options.mouseInteractionDistance === 0) return
    
        var closestElements = []
        // var distanceToClosestElement = maximumPossibleDistance;
    
        for (var x = 0; x < objects.length; x++) {
          var testedObject = objects[x]
          var distance = getDistance(this, testedObject)
    
          if ((distance < options.mouseInteractionDistance) && (testedObject !== this)) {
            closestElements.push(objects[x])
          }
        }
    
        for (var i = 0; i < closestElements.length; i++) {
          if (options.drawMouseConnections) {
            var element = closestElements[i]
            ctx.beginPath()
            ctx.moveTo(this.positionX, this.positionY)
            ctx.lineTo(element.positionX + element.size * 0.5, element.positionY + element.size * 0.5)
            ctx.strokeStyle = 'rgba(' + options.mouseConnectionRed + ',' + options.mouseConnectionGreen + ',' + options.mouseConnectionBlue + ',' + options.mouseConnectionOpacity + ')'
            ctx.stroke()
            lines++
          }
          if (options.mouseGravity) {
            closestElements[i].vectorX = this.positionX
            closestElements[i].vectorY = this.positionY
          }
        }
      }
      Particle.prototype.updateAnimation = function () {
        this.animateTo(this.vectorX, this.vectorY)
        this.testInteraction()
        ctx.fillStyle = this.color
        ctx.fillRect(this.positionX, this.positionY, this.size, this.size)
      }
      MouseParticle.prototype.updateAnimation = function () {
        this.positionX = mousePositionX
        this.positionY = mousePositionY
        this.testInteraction()
      }
      var createParticles = function () {
        // create mouse particle
        mouseElement = new MouseParticle(0, 0, options.initialSize, 255, 255, 255)
        for (var x = 0; x < options.particlesNumber; x++) {
          var randomX = Math.floor((Math.random() * window.innerWidth) + 1)
          var randomY = Math.floor((Math.random() * window.innerHeight) + 1)
          var particle = new Particle(randomX, randomY, options.initialSize, options.red, options.green, options.blue, options.opacity)
          particle.calculateVector()
          objects.push(particle)
        }
      }
      var updatePosition = function () {
        for (var x = 0; x < objects.length; x++) {
          objects[x].updateAnimation()
        }
        // handle mouse
        mouseElement.updateAnimation()
      }
      window.onmousemove = function (e) {
        mousePositionX = e.clientX
        mousePositionY = e.clientY
      }
      var clearCanvas = function () {
        ctx.clearRect(0, 0, window.innerWidth, window.innerHeight)
      }
      var lastCalledTime
      var fps
      var averageFps
      var averageFpsTemp = 0
      var averageFpsCounter = 0
    
      function requestFps () {
        if (!lastCalledTime) {
          lastCalledTime = Date.now()
          fps = 0
          return
        }
        var delta = (new Date().getTime() - lastCalledTime) / 1000
        lastCalledTime = Date.now()
        fps = Math.floor(1 / delta)
    
        averageFpsTemp = averageFpsTemp + fps
        averageFpsCounter++
        if (averageFpsCounter === 5) {
          averageFps = Math.floor(averageFpsTemp / 5)
          averageFpsCounter = 0
          averageFpsTemp = 0
        }
        if (!averageFps) {
    
        } else if (averageFps < 10) {
    
        }
      }
      var loop = function () {
        clearCanvas()
        updatePosition()
        ctx.fillStyle = '#fff'
        // ctx.fillText("FPS: " + fps + " lines: " + lines + " Average FPS: " + averageFps , 10, 20);
        lines = 0
        requestAnimationFrame(loop)
        requestFps()
      }
      initAnimation()
      loop()
      return lines
    }
    
    

    2.引入canvas.js,实现效果

    <template>
      <div class="canvas-page">
        <canvas></canvas>
      </div>
    </template>
    <script>
    import { canvas } from '../plugins/canvas'
    export default {
      name: 'CanvasPage',
      mounted () {
        canvas(document.getElementsByTagName('canvas')[0])
      }
    }
    </script>
    <style lang="less" scoped>
    .canvas-page {
      height: 100vh;
      width: 100vw;
      background-size: cover;
      position: relative;
      background-color: #474747;
      background-image: radial-gradient(circle at 2% 60%, #27278f, transparent 100%),
        radial-gradient(circle at 98% 70%, #000c91, transparent 100%),
        radial-gradient(circle at 50% 50%, #ed68ed, transparent 100%);
      canvas {
        position: absolute;
        left: 0;
        top: 0;
        background: transparent;
        z-index: 15;
      }
    }
    </style>
    
    

    附:canvas速查表 http://canvas.migong.org/html5-canvas

    展开全文
  • python画折线图-python如何画折线

    千次阅读 2020-10-28 21:28:07
    python画折线图利用的是matplotlib.pyplot.plot的工具来绘制折线图,这里先给出一个段代码和结果图:# -*- coding: UTF-8 -*-import numpy as npimport matplotlib as mplimport matplotlib.pyplot as plt#这里导入...

    5f571eacbf1c2385.jpg

    python画折线图利用的是matplotlib.pyplot.plot的工具来绘制折线图,这里先给出一个段代码和结果图:# -*- coding: UTF-8 -*-

    import numpy as np

    import matplotlib as mpl

    import matplotlib.pyplot as plt

    #这里导入你自己的数据

    #......

    #......

    #x_axix,train_pn_dis这些都是长度相同的list()

    #开始画图

    sub_axix = filter(lambda x:x%200 == 0, x_axix)

    plt.title('Result Analysis')

    plt.plot(x_axix, train_acys, color='green', label='training accuracy')

    plt.plot(sub_axix, test_acys, color='red', label='testing accuracy')

    plt.plot(x_axix, train_pn_dis, color='skyblue', label='PN distance')

    plt.plot(x_axix, thresholds, color='blue', label='threshold')

    plt.legend() # 显示图例

    plt.xlabel('iteration times')

    plt.ylabel('rate')

    plt.show()

    #python 一个折线图绘制多个曲线

    结果如下

    1566617745680957.jpg

    这里谈谈matplotlib.pyplot.plot()的使用方法,然后我说下可能用到的一些参数,参数可选的内容我就不一一展开了,需要的可自行查询官方文档

    color:曲线颜色,blue,green,red等等

    label:图例,这个参数内容就自定义啦,注意如果写这个参数一定要加上plt.legend(),之后再plt.show()才有有用!

    linestyle:曲线风格,’–’,’-.’,’:’等等

    linewidth:曲线宽度,自定义就可以

    marker:标记点样式,’o’,’x’,也就是说这些符号会标示出曲线上具体的"点”,这样一来就易于观察曲线上那些地方是支撑点

    markersize:标记点的大小,自定义就可以。

    展开全文
  • svg画折线

    千次阅读 2017-03-29 12:34:41
    polyline:画折线标签 points:属性里定义了各个点的坐标,x和y坐标之间用逗号分别,多个坐标之间用空格分割fill:填充颜色(画折线一般把属性设置为none) stroke:边框颜色 stroke-width:边框宽带 ill-opacity:透明...
    • polyline:画折线标签
    • points:属性里定义了各个点的坐标,xy坐标之间用逗号分别,多个坐标之间用空格分割
    • fill:填充颜色(画折线一般把属性设置为none)
    • stroke:边框颜色
    • stroke-width:边框宽带
    • ill-opacity:透明度
    • stroke-opacity:边框的透明度
    <svg version="1.1">
     <polyline points="120,120 120,80 160,80 160,40 200,40"
    style="fill:white;stroke:#68f;stroke-width:2"/>
    </svg>
    另外一种写法<svg>svg路径
    <svg style="fill:white;stroke:#68f;stroke-width:2 version="1.1">
      <path d="M120 120 V80 H160 V40 H200" />
    </svg>
























    展开全文
  • iOS 折线图动画

    千次阅读 2014-05-28 21:36:54
    最近做了一个小demo,里面需要动态绘制一个折线图,研究了一下用CABasicAnimation实现了。 demo在这,欢迎大神指点。 1.使用步骤 我简单封装了一下,现在完全可以当一个简单的view来使用。 ...
  • python画折线图利用的是matplotlib.pyplot.plot的工具来绘制折线图,这里先给出一个段代码和结果图:# -*- coding: UTF-8 -*-import numpy as npimport matplotlib as mplimport matplotlib.pyplot as plt#这里导入...
  • dataframe画折线图-按照行

    千次阅读 2020-02-21 10:57:28
    dataframe画折线图貌似都是默认按照每列,也就是按照column,有没有什么方法能按照行啊?就是每行的数据成一个折线图?
  • python画折线图方法前做PPT要用到折线图,嫌弃EXCEL自带的看上去不好看,就用python写了一个画折线图的程序。import matplotlib.pyplot as pltx=[1,2,3,4,5,6]y1=[35000,85000,120000]y2=[45000,85000,100000]y3=...
  • QT画折线

    千次阅读 2015-08-25 09:15:38
    使用第三方库是实现用qt画折线
  • 本文实例为大家分享了python画折线图的具体代码,供大家参考,具体内容如下# encoding=utf-8import matplotlib.pyplot as pltfrom pylab import * #支持中文mpl.rcParams['font.sans-serif'] = ['SimHei']names = ['...
  • mfc通过鼠标点击来画折线
  • matplotlib画折线

    千次阅读 2018-12-16 21:16:46
    matplotlib画折线图 假设一天中每隔两个小时(range(2,26,2))的气温(℃)分别是[15,13,14.5,17,20,25,26,26,27,22,18,15] 代码如下: # 导入pyplot from matplotlib import pyplot as plt # 数据在X轴的位置,是一...
  • 画折线图软件

    2013-09-13 16:56:47
    用于画图,坐标和线条距离可以自己改 可以实现多种功能
  • //折线 Catalog Cat = MapInfo.Engine.Session.Current.Catalog;    Table tblTemp = Cat.GetTable("Line"); MapInfo.Geometry.DPoint[] point=new DPoint[3]; tblTemp.BeginAccess(TableAccessMode.W
  • Unity 画折线

    千次阅读 2018-03-14 11:44:55
    此处的 unity 版本为 5.6 ,不同的的版本,有些API可能不一样 Unity 在不使用第三方插件的前提下画折线图,目前比较好用的方法是用 Unity 自带的 LineRenderer 组件,别的不说,先上代码:using System.Collections...
  • unity3d画折线

    热门讨论 2013-04-02 21:55:26
    用unity3d产生随机数然后折线图,可以用于各种数据的图形显示。
  • 用Delphi实现的读取txt文档数据画折线
  • matlab 画折线

    万次阅读 2019-05-17 17:47:30
    代码: ...plot(x,a,'-*b',x,b,'-or')是设置折线图中相应点和线的特征的,函数说明如下: 对于‘’内的线条形状,总结了如下图: 线型: 线条宽度: 指定线条的宽度,取值为整数(...
  • python 画折线

    千次阅读 2016-07-27 12:01:48
    python 画折线图 1. 安装依赖的包  安装Numpy, Scipy,Matplotli  分别输入下面的代码进行安装:  pip install numpy pip install scipy sudo apt-get install python-matplotlib   测试是否安装成功  python >...
  • Python折线

    2020-11-07 10:44:06
    Python折线图!
  • 本文实例为大家分享了python画折线图的具体代码,供大家参考,具体内容如下# encoding=utf-8import matplotlib.pyplot as pltfrom pylab import * #支持中文mpl.rcParams['font.sans-serif'] = ['SimHei']names = ['...
  • vs2010画折线

    2015-07-22 22:15:16
    代码挺简单的,用VS2010画折线图,适合初学者
  • iOS画折线

    千次阅读 2014-03-02 19:16:47
    //背景线条------------------ CGColorRef backColorRef = [UIColor redColor].CGColor; CGFloat backLineWidth = 0.5f; CGFloat backMiterLimit = 0.f; CGContextSetLineWidth(context, backLineWidth);//...
  • 使用AChartengine画折线图Demo
  • 【python】画折线

    万次阅读 多人点赞 2019-08-12 16:52:07
    画折线图至少需要2个列表:横坐标列表和纵坐标列表,两个坐标的位置一一对应。 from pylab import * mpl.rcParams['font.sans-serif'] = ['SimHei'] x_axis_data = [1, 2, 3, 4, 5] y_axis_data = [1, 2, 3, 4, 5] ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 35,754
精华内容 14,301
关键字:

对折线怎么画