[vtkusers] Add error bars to a 2D scatter plot

Bill Lorensen bill.lorensen at gmail.com
Tue Aug 21 09:48:27 EDT 2018


This example might be useful.
https://lorensen.github.io/VTKExamples/site/Cxx/Plotting/BoxChart/

On Tue, Aug 21, 2018, 6:33 AM Purves, Murray <purvesmh at ornl.gov> wrote:

> Thanks very much, anything you do find would be greatly appreciated – and
> if you can’t, any pointers you might have re: putting together a class
> would be fantastic as well.
>
>
>
> Cheers
>
>
>
> Murray
>
>
>
>
>
>
>
> *From: *"Marcus D. Hanwell" <marcus.hanwell at kitware.com>
> *Date: *Monday, August 20, 2018 at 16:02
> *To: *"Purves, Murray" <purvesmh at ornl.gov>
> *Cc: *"vtkusers at public.kitware.com" <vtkusers at public.kitware.com>
> *Subject: *Re: [vtkusers] Add error bars to a 2D scatter plot
>
>
>
> On Mon, Aug 13, 2018 at 2:20 PM Purves, Murray <purvesmh at ornl.gov> wrote:
>
> Hi,
>
> 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.
> I can't find any obvious references in the documentation to error bars;
> the only mention I have found is in a presentation at:
> https://na-mic.org/w/images/1/18/NA-MIC-VTK-Charts-2011.pdf, which
> doesn't seem to be a function that exists.
>
> 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.
> 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?
>
>
>
> 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.
>
>
>
> 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.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180821/aad8097d/attachment.html>


More information about the vtkusers mailing list