[vtk-developers] How to set vtkAxis`s origin point position in 2d X/Y plot?

Leslie Zhai xiangzhai83 at gmail.com
Fri Aug 23 03:39:18 EDT 2013


Hi vtk developers,

I am a newbie of libvtk, so simply copy the
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Plotting/ScatterPlot source
code, then try to be familar with vtkAxis, vtkOther objects.

The ScatterPlot example is using AutoScale axis, then I learned how to
set range and FIXED X/Y axis, the source code shown as below:

// Y Axis
chart->GetAxis(0)->SetBehavior(vtkAxis::FIXED);
chart->GetAxis(0)->SetRange(0, 2050);
// X Axis
chart->GetAxis(1)->SetBehavior(vtkAxis::FIXED);
chart->GetAxis(1)->SetRange(0, 4000);

NOTE: chart object is vtkSmartPointer<vtkChartXY> chart =
vtkSmartPointer<vtkChartXY>::New();

And ScatterPlot example`s origin point position is LEFT && BOTTOM, I
just want to change it into LEFT && TOP
But I tried to SetPosition, SetPoint1 and other vtkAxis`s APIs for
setting the origin point position to LEFT && TOP, it all failed :(

Please someone give me some advice, thanks a lot!

Leslie Zhai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20130823/fcc4cf69/attachment.html>


More information about the vtk-developers mailing list