[vtkusers] Help with vtkXYPlotActor

Curtis Cooper curtis at hindmost.LPL.Arizona.EDU
Fri May 14 14:27:21 EDT 2004


Hi,

I am interested in plotting pairs of input X, Y vectors using VTK, with
the ability to set the attributes of each dataset separately, as is done
in the example xyPlot.py.

My vectors start as STL vectors.  How do I get that into the dataset
format understood by the vtkXYPlotActor class?  For an example C++ usage,
I want to be able to do this:


vector<vtkFloatingPointType> x, y2, y3;

x.push_back(1); x.push_back(2); x.push_back(3);
x.push_back(4); x.push_back(5); x.push_back(6);

y2.push_back(1); y2.push_back(4); y2.push_back(9);
y2.push_back(16); y2.push_back(25); y2.push_back(36);

y3.push_back(1); y3.push_back(8); y.push_back(27);
y3.push_back(64); y3.push_back(125); y.push_back(216);

QueueVectorPair(x, y2);
QueueVectorPair(x, y3);

Plot();


Thanks,
Curtis




More information about the vtkusers mailing list