# Control vtkCubeAxesActor ticks spacing

**URL:** https://discourse.vtk.org/t/control-vtkcubeaxesactor-ticks-spacing/15430
**Category:** Support
**Tags:** python
**Created:** [March 26, 2025, 10:17am UTC](https://discourse.vtk.org/t/control-vtkcubeaxesactor-ticks-spacing/15430 "2025-03-26T10:17:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Julien\_Champagnol](https://discourse.vtk.org/user_avatar/discourse.vtk.org/julien_champagnol/32/9415_2.png) [@Julien\_Champagnol](https://discourse.vtk.org/u/Julien_Champagnol)
#### Post date: [March 26, 2025, 10:17am UTC](https://discourse.vtk.org/t/control-vtkcubeaxesactor-ticks-spacing/15430/1 "2025-03-26T10:17:57Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [March 28, 2025, 5:52pm UTC](https://discourse.vtk.org/t/control-vtkcubeaxesactor-ticks-spacing/15430/2 "2025-03-28T17:52:08Z")

</div>

Hello,

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

Complete configuration in my program (C++):

```cpp

        // 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
