- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我的完整代码:
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import pandas as pd
import numpy as np
path = 'C:\\MyPath\\File1.txt'
dff = pd.read_csv(path, sep=",")
dff.columns = ['Date','Time','Price','Volume']
dff.plot('Time', ['Price', 'Volume'], secondary_y='Volume')
plt.show()
我有一个价格-成交量 DataFrame,我使用以下语法在第二个 y 轴上绘制成交量
。
dff.plot('Time', ['Price', 'Volume'], secondary_y='Volume')
我在Volume
列中的数据范围为0-500。当我使用上述语法绘制它时,第二个 y 轴采用 Volume
的最大值和最小值并自动调整范围。
我需要在绘图时将支架固定在第二个 y 轴上。我想要 Volume
的范围为 0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500
示例数据:
Date Time Price Volume
72612 31/01/2019 15:26:58 135.85 100
72613 31/01/2019 15:27:02 135.90 110
72614 31/01/2019 15:27:03 135.95 140
72615 31/01/2019 15:27:07 135.95 100
72616 31/01/2019 15:27:10 135.85 60
72617 31/01/2019 15:27:11 135.90 150
72618 31/01/2019 15:27:13 135.95 100
72619 31/01/2019 15:27:15 135.95 100
72620 31/01/2019 15:27:18 135.95 30
72621 31/01/2019 15:27:22 135.95 10
示例图片更清晰
最佳答案
由于您想要控制/修改辅助 y 轴刻度标签,因此我将使用略有不同的方法来绘制:一次绘制一列。绘制辅助 y 轴数据后,您可以通过提供所需刻度标签列表来覆盖默认刻度标签。根据您提供的 DataFrame,以下是一种方法
# Read in your dataframe here
ax = dff.plot('Time','Price')
ax2 = dff.plot('Time','Volume', ax=ax, secondary_y=True)
y_ticks = range(0, 501, 50)
ax2.set_yticklabels(y_ticks)
plt.show()
关于python - 如何固定第二个 y 轴的体积范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54495784/
我正在尝试让这段代码计算盒子的表面积和体积。它编译但不输出正确的数据。我认为问题可能出在 void Box::零件内,但碰壁了。或者它可能是 Height = Height 但我无法以任何其他方式让它
我需要一个使用 kinect 计算 body 体积(以立方米为单位)的算法。我知道我可以提取云和深度框架(通过使用骨架 NUI 的一些方法隔离 body )但我不知道如何从这个矩阵计算体积值。导出卷
我是 d3 的新手,并试图根据节点之间的连接数使链接的宽度动态化。比方说,我们有: "links": [ { "source": a, "target": b},
我要渲染 3D 数据,它是一个一维数组。此数据在将进行可视化的同一程序中预先计算。数据表示统一的 3D 网格。网格的每个单元格都由一个 vector 组成。 GridSize = dx * dy *
我尝试在 jupyter notebook 中使用 mayavi 渲染体积来测试下面的示例 from mayavi import mlab mlab.init_notebook() x, y, z =
我尝试了几种不同的方法。我需要使用继承来扩展这些类。每次我运行该程序时,它都会输出 0.0 的体积和面积。半径显示正确。输出在底部。 public class Base_HW04Q1 { pu
我参与了一个项目,我需要根据体积的一系列图像渲染 3D 体积。这些图像是通过多种技术创建的,因此它们是所讨论对象的垂直切片。 数据集类似于this question , 但提问者正在寻找 Matlab
已关闭。此问题旨在寻求有关书籍、工具、软件库等的建议。不符合Stack Overflow guidelines准则。它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,
我想知道是否有任何基于 numpy 的工具可以: 给定一个二值输入的 3D numpy 图像,找到它的凸包; 并返回索引列表或此 3D 凸包内的体素(3D 像素)的类似物。 一种可能是使用skimag
我要使用 Matlab 从灰度图像集创建一个 3D 体积。一组包含二维灰度图像的连续量化切片。我仍然认为自己是 Matlab 的菜鸟,但这是我目前的想法: 为 3D 体积创建一个空白空间。 在每张图片
我有一个 3D 体积和一个 2D 图像以及两者之间的近似映射(没有倾斜的仿射变换,已知缩放,旋转和平移近似已知并且需要拟合)。因为这个映射有错误,我想进一步将 2D 图像注册到 3D 体积。我以前没有
更新: 我创建了一个文档齐全的 ipython 笔记本。如果您只想要代码,请查看第一个答案。 问题 我有一个 40x40x40 体积的灰度值。这需要旋转/移动/剪切。 这是一组有用的齐次变换:http
看似简单的问题,没有图像处理/处理经验的人其实没那么容易。 我不只是想将 2D 阵列堆叠在一起,而是通过合并多个由空白分隔的二进制 2D 切片来创建 3D 体积。 例子: 用零定义一个 3D 矩阵:
我非常沮丧,因为几个小时后,我似乎无法在 python 中进行看似简单的 3D 插值。在 Matlab 中,我所要做的就是 Vi = interp3(x,y,z,V,xi,yi,zi) 使用 scip
我是一名优秀的程序员,十分优秀!