[vtkusers] vtkXYPlotActor plot style problem, try again.

Amy givemethecoffee at yahoo.com.au
Wed Jan 21 19:12:18 EST 2009


Hi Marcin,

I'm having exactly the same problem, but I got mine to work.

I think you have to turn both global points and global lines off, enable 
per-curve points and lines, and then set each input's properties 
individually.

This is what I used to plot one line with points and another with a line:

plot = vtkXYPlotActor::New();

.....

plot->PlotLinesOff();
plot->PlotPointsOff(); // these set global plot lines/points off

plot->PlotCurvePointsOn();
plot->PlotCurveLinesOn();  // these enable per-curve plotting of
lines/points

....

plot->AddInput( curve1 );
plot->AddInput( curve2 );

// curve1 has points and no lines
plot->SetPlotLines( 0, 0 );
plot->SetPlotPoints( 0, 1 );

// curve2 has lines and no points
plot->SetPlotLines( 1, 1 );
plot->SetPlotPoints( 1, 0 );

And that works for me. If you don't do SetPlotLines/Points on each 
individual data set, the default (for me) was lines with no points.
(You can do lines and points too, but you have to increase the point 
size or you won't see them, they're only a pixel wide for me)

I hope that works for you.

Amy




More information about the vtkusers mailing list