# Odd color problem with vtkCubeAxesActor

**URL:** https://discourse.vtk.org/t/odd-color-problem-with-vtkcubeaxesactor/10659
**Category:** Support
**Created:** [February 11, 2023, 5:01pm UTC](https://discourse.vtk.org/t/odd-color-problem-with-vtkcubeaxesactor/10659 "2023-02-11T17:01:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![BlueKnight7](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/838e76/32.png) [@BlueKnight7](https://discourse.vtk.org/u/BlueKnight7)
#### Post date: [February 11, 2023, 5:01pm UTC](https://discourse.vtk.org/t/odd-color-problem-with-vtkcubeaxesactor/10659/1 "2023-02-11T17:01:21Z")

</div>

Working with the online example:  
[https://kitware.github.io/vtk-examples/site/Cxx/Utilities/DetermineActorType/](https://kitware.github.io/vtk-examples/site/Cxx/Utilities/DetermineActorType/)

I added the following lines to show inner grid lines and set the ones for the X axis to a red-like color plus setting the axes to a black:

cubeAxesActor-\>GetXAxesLinesProperty()-\>SetColor(0.1, 0.1, 0.1);  
cubeAxesActor-\>GetYAxesLinesProperty()-\>SetColor(0.1, 0.1, 0.1);  
cubeAxesActor-\>GetZAxesLinesProperty()-\>SetColor(0.1, 0.1, 0.1);

cubeAxesActor-\>GetTitleTextProperty(0)-\>SetColor(0.1, 0.1, 0.1);  
cubeAxesActor-\>GetTitleTextProperty(1)-\>SetColor(0.1, 0.1, 0.1);  
cubeAxesActor-\>GetTitleTextProperty(2)-\>SetColor(0.1, 0.1, 0.1);

cubeAxesActor-\>GetXAxesInnerGridlinesProperty()-\>SetColor(0.9, 0.1, 0.1);

cubeAxesActor-\>SetDrawXInnerGridlines(true);  
cubeAxesActor-\>SetDrawYInnerGridlines(true);  
cubeAxesActor-\>SetDrawZInnerGridlines(true);

As one rotates the “object” the red inner grid lines change to green (must be default) and then back to the red and so on. This is really **odd** behavior and shouldn’t happen. I expect the inner grid lines to stay with the color to which they were set.

---

<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: [February 14, 2023, 10:32pm UTC](https://discourse.vtk.org/t/odd-color-problem-with-vtkcubeaxesactor/10659/2 "2023-02-14T22:32:45Z")

</div>

Hello,

Can you try this:

```cpp
cubeAxesActor->GetXAxesInnerGridlinesProperty()->SetColor(0.9, 0.1, 0.1);
cubeAxesActor->GetYAxesInnerGridlinesProperty()->SetColor(0.9, 0.1, 0.1);
cubeAxesActor->GetYAxesInnerGridlinesProperty()->SetColor(0.9, 0.1, 0.1);

```

This way you will get red grid lines independently of orientation, if I understood your problem right.

take care,

Paulo
