python - 如何计算速度的相空间并在python中绘制散点图?
问题描述
我有一个时间序列速度的向量。例如 :
u=[100,120,150,115,130,115,105,103,108,132,135,121]
现在我需要计算Δu,然后绘制散点图。如下图所示。我怎样才能做到这一点?
解决方案
import numpy as np
import matplotlib.pyplot as plt
u = np.array([100,120,150,115,130,115,105,103,108,132,135,121])
du = u[1:] - u[:-1] # the difference between the current and the prior velocity
plt.scatter(u[1:],du)
plt.show()
推荐阅读
- postgresql - 如何修复 postgres 安装 ubuntu 上的错误
- roku - 如何正确使用 LayoutGroups?
- r - R Shiny app error : Warning in charToRaw(enc2utf8(text)) : r of length 1 all but the first element will be
- angular - 在 Angular 5 中预填充复选框
- r - 缺少组的配对条形图导致轴标签不正确
- angular - 编写自定义角度管道,扩展货币管道以缩写大值,同时仍使用核心货币管道功能
- eslint - ESLint 没有为 console.log 发送警告
- wxpython - 如何在 wxpython 中制作单行文本输入对话框?
- javascript - 在 Promise 或 Callbacks (JavaScript ES6) 中处理此问题的正确方法
- python - 在python中绘制均匀间隔的线