[vtkusers] SetCurvePoints/Lines not overriding default - bug in XYPlotActor?

Paul Cochrane cochrane at esscc.uq.edu.au
Fri Apr 15 01:20:50 EDT 2005


Hi all,

I've been trying to help out another person on the list, and have run into
what could be a possible bug in the XYPlotActor class.  The problem is that
setting PlotCurveLinesOn() or PlotCurvePointsOn() doesn't (seem to) override
the default global setting.  The comments in vtkXYPlotActor.h are as
follows:

// Allow per-curve specification of line and point rendering.  These override
// global settings PlotPoints and PlotLines.  If not on, the default behavior
// is governed by PlotPoints and PlotLines ivars.

However, having experimented with this, I have found that by having code
like the following (in python):

plot = vtk.vtkXYPlotActor()
... < more code >

plot.PlotCurvePointsOn()

still plots the curves (in a multi-curve x-y plot) as lines.  Note that if
one prints the plot object, the PlotCurvePoints variable is set to On.

To get around this (sort of) one actually has to first unset the global
variables like so:

plot.PlotLinesOff()
plot.PlotPointsOff()

and then turn the points styles on by calling PlotCurvePointsOn().

One more problem that I've found here is that if one wants to plot one curve
as lines and another as points, one would naiively think that one should
also set PlotCurveLinesOn() and then use the SetPlotPoints(int i, int) and
SetPlotLines(int i, int) methods to control the individual curves.  If one
does this by eg:

plot.PlotLinesOff()
plot.PlotPointsOff()
plot.PlotCurvePointsOn()
plot.PlotCurveLinesOn()
plot.SetPoints(0, 1)
plot.SetLines(1, 1)

Then the curves come out as being lines no matter what.  If one removes the
PlotCurveLinesOn() line, then only one curve is shown, and that is the one
that has been set to use points.

This behaviour is quite frustrating as it seems that it is in fact
impossible to set different curves to lines or points on the one plot.
However, reading the source everything seems to be in ok.  Could this be a
user problem?  Am I just not using the class correctly?

One other comment I would like to make is that the documentation has large
holes in it.  Specifically in the methods that I mention above.  I'm using
vtk 4.2, but the current CVS version has large holes in the docs as well.  I
could supply a patch or patches adding doxygen documentation to as many
methods as I can work out how they function but I can't be much more help
than that.  (I wish I could be of more help).

Anyway, it would be great if these issues could be seen to or at least
replied to so that a solution exists for when people try to solve the same
problem in the future.

Many thanks in advance,

Paul Cochrane

-- 
Paul Cochrane
Computational Scientist/Software Developer
Earth Systems Science Computational Centre
Rm 703, SMI Building
University of Queensland
Brisbane
Queensland 4072
Australia



More information about the vtkusers mailing list