[vtkusers] Getting the Y Range of a XY Plot

Matt Schmiermund matt at plasticflow.com
Tue Jun 21 12:12:53 EDT 2005


For some reason some of the plots I create using
vtkXYPlotActor have the Y range incorrect. Values are
from 0 to .12, but the range is set to -.01 to .11
which cuts off a bit of the graph.

This only happens occasionally and I am trying to fix
it by getting the Y range of the plot and checking to
see if the lower value is below zero. If it is then I
am changing the range to 0.0 to the absolute value of
the old lower range plus the old upper range. 

However my attempts at getting the Y range have
failed. Here are the two different methods that I have
tried

double *graphRange;
graphRange = xyplot->GetYRange();
cout << "graphRange[0] is " << graphRange[0] <<
   " graphRange[1] is " << graphRange[1] << endl;

and 
 
double graphBounds[2];
xyplot->GetYRange(graphBounds);
cout << "graphBounds[0] is " << graphBounds[0] <<
   " graphBounds[1] is " << graphBounds[1] << endl;

I do this just before I add the xyplot to the render
window. With either method both of the arrays end up
with two zeros as thier values.

I am using the cvs version I downloaded yesterday.

If anyone knows why I am getting 0 instead of the
actual values I would appreciate some help.

-Matt



More information about the vtkusers mailing list