简体   繁体   English

向VTK 2D散点图添加误差线

[英]Add error bars to a VTK 2D scatter plot

Is there a way to add error bars to scatter plot data using VTK? 有没有一种方法可以使用VTK添加误差线来散布绘图数据? I am currently plotting point data using the C++ API; 我目前正在使用C ++ API绘制点数据; there is uncertainty associated with the data I am trying to plot which I would like to visualise also. 我要绘制的数据存在不确定性,我也想将其可视化。

I can't find any obvious references in the documentation to error bars; 我在文档中找不到任何明显的错误栏参考; the only mention I have found is in this Kitware presentation from 2011 , which doesn't seem to be a function that exists. 我发现的唯一提及是在2011年的Kitware演示文稿中 ,它似乎不存在。

Sample code snippet: 示例代码段:

// Chart source data is populated etc...

vtkPlot* sampleScatter = chartXY->AddPlot(vtkChart::POINTS);
sampleScatter->SetInputData(chartDataTable, 0, 1);
// Here is where I would like to add the error bars - 
// below method is from the link, and does not work
vtkPlotPoints::SafeDownCast(sampleScatter)->SetErrorArray(errorData.GetPointer());

// Chart is rendered...

where chartXY is a vtkChartXY object and chartDataTable is a vtkTable containing the x and y data in columns 0 and 1. 其中chartXYvtkChartXY对象,而chartDataTablevtkTable其中包含第0列和第1列中的x和y数据。

Is there a way to populate error data for visualisation in a similar fashion to the above, or will I have to roll my own chart type? 是否可以通过与上述类似的方式填充错误数据以进行可视化显示,还是我必须滚动自己的图表类型?

It turns out that this is not a capability that exists in VTK at the moment. 事实证明,这不是VTK目前存在的功能。

I have developed a basic capability to do this, which is currently the subject of a merge request in the VTK repository. 我已经开发了执行此操作的基本功能,当前是VTK存储库中合并请求的主题。 Will update if/when this has been merged in and the capability is available. 如果已合并此功能并且可用,将进行更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM