Control vtkCubeAxesActor ticks spacing

Hi,

Is there a way to control the ticks/grid spacing of a vtkCubeAxesActor in Python? This is done in paraview, and I would like to know how it could be done in vtk.

Thanks

Julien

1 Like

Hello,

I use vtkCubeAxesActor2D. Then call ScalingOff() and SetNumberOfLabels( 42 ) on it.

Complete configuration in my program (C++):


        // Create a text style for the cube axes.
        vtkSmartPointer<vtkTextProperty> tprop = vtkSmartPointer<vtkTextProperty>::New();
        tprop->SetColor(1, 1, 1); //white
        tprop->ShadowOn();
        tprop->SetFontSize(20);

        // Add scaling to the edges of the cube.
        _axes = vtkSmartPointer<vtkCubeAxesActor2D>::New();
        _axes->SetViewProp( spectrogramActor.GetPointer() );
        _axes->SetCamera( _renderer->GetActiveCamera() );
        _axes->SetLabelFormat("%6.4g");
        _axes->SetFlyModeToClosestTriad();
        _axes->ScalingOff();
        _axes->SetNumberOfLabels( 5 );
        _axes->SetZLabel("Feature Size");
        _axes->SetAxisTitleTextProperty( tprop.GetPointer() );
        _axes->SetAxisLabelTextProperty( tprop.GetPointer() );
        _renderer->AddViewProp( _axes.GetPointer() );

best,

PC