<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Aug 13, 2018 at 2:20 PM Purves, Murray <<a href="mailto:purvesmh@ornl.gov" target="_blank">purvesmh@ornl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Is there a way to add error bars to scatter plot data using VTK? I am currently plotting point data using the C++ API; there is uncertainty associated with the data I am trying to plot which I would like to visualise also.<br>
I can't find any obvious references in the documentation to error bars; the only mention I have found is in a presentation at: <a href="https://na-mic.org/w/images/1/18/NA-MIC-VTK-Charts-2011.pdf" rel="noreferrer" target="_blank">https://na-mic.org/w/images/1/18/NA-MIC-VTK-Charts-2011.pdf</a>, which doesn't seem to be a function that exists.<br>
<br>
Sample code snippet:<br>
<br>
// Chart source data is populated etc...<br>
<br>
vtkPlot* sampleScatter = chartXY->AddPlot(vtkChart::POINTS);<br>
sampleScatter->SetInputData(chartDataTable, 0, 1);<br>
// Here is where I would like to add the error bars - <br>
// below method is from the link, and does not work<br>
vtkPlotPoints::SafeDownCast(sampleScatter)->SetErrorArray(errorData.GetPointer());<br>
<br>
// Chart is rendered...<br>
<br>
where chartXY is a vtkChartXY object and chartDataTable is a vtkTable containing the x and y data in columns 0 and 1.<br>
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?<br></blockquote><div><br></div><div>I wrote those slides, and the code that generated them... I don't remember how I did the error bars, I will see if I can dig it out, but I suspect it was a feature that was never quite finished up. There weren't a lot of people clamoring for error bars at the time, and we were busy adding lots of things to charts.</div><div><br></div><div>It wouldn't be that much work to add as you suggest, I think my prototype had a similar form, but I am not aware of any follow up work to complete it. Recent VTK doesn't need Get/GetPointer either.</div></div></div>