[vtkusers] Recommended way to create a 2D scatter plot

Ben Medina ben.medina at gmail.com
Wed Aug 4 14:57:05 EDT 2010


Thanks!

One thing I can't figure out is how to plot data from a
vtkPolyDataAlgorithm output, and keep the plot updating as the poly
data changes. I am using vtkDataObjectToTable, but as far as I can
tell, there's no way for vtkPlotPoints to use a table algorithm as
input. In other words, I was expecting this to work:

vtkSmartPointer<vtkDataObjectToTable> dataToTable =
vtkSmartPointer<vtkDataObjectToTable>::New();
...
vtkPlot* pointPlot = chart->AddPlot(vtkChart::POINTS);
pointPlot->SetInputConnection(dataToTable->GetOutputPort(), 0, 1);

But there is no such SetInputConnection API. So I'm fetching the
vtkTable from the vtkDataObjectToTable, and using SetInput, which
means changes made upstream in the pipeline don't propagate to the
plot. Am I missing something?

Thanks,
Ben

On Mon, Aug 2, 2010 at 7:56 AM, Marcus D. Hanwell
<marcus.hanwell at kitware.com> wrote:
> On Thu, Jul 29, 2010 at 7:20 PM, Ben Medina <ben.medina at gmail.com> wrote:
>>
>> A couple features are critical:
>> - Ability to color scatter points based on the values from another array.
>> - Ability to size scatter points based on the values from another array.
>>
>> Is this possible (or planned) in the VTK Charts API?
>>
> I merged in a topic branch with a new test called TestScatterPlot on Friday
> morning. This shows some of the basic features such as changing the symbol
> used for points, setting the color etc. Color/size by other arrays is not
> currently supported, it is a planned feature but I can't give you a definite
> date when that would go in.
> This is open source though, so patches are always welcome ;-) I would be
> happy to work with external contributors to merge in new functionality to
> the charts.
> Marcus
> --
> Marcus D. Hanwell, Ph.D.
> R&D Engineer, Kitware Inc.
> (518) 881-4937



More information about the vtkusers mailing list