Is there a way to fix the number of labels on the Axes Grid?

We are running into a performance issue displaying the axes grids. The default function increases the number of labels depending on the zoom factor. I assume the code is trying to keep the labels equally spaced in screen space, but the issue is that the number of labels is unbounded. I suspect the cpu code keeps generating more and more labels, even though only a few can be seen, which slows the framerate below 1 FPS.

I can’t seem to find a property to set in python that fixes the number of ticks/labels, and creating custom ticks is not really an option either since the data ranges are always changing depending on what is visible. Anyone have a suggestion to fix the performance?

related: Axis labels are out of control

Thanks for the report. Yes, this is a bug (and once I replicated it, a bad one). Wrote it up here: https://gitlab.kitware.com/paraview/paraview/-/issues/22153. Scheduled for this fall, not to slip past next spring.

Alan, thanks for escalating the priority. I am going to look into workarounds inside paraview. I have a couple ideas, but I need to get things building to test them.

For what its worth, this is how I solved the issue:

diff --git a/Charts/Core/vtkAxis.cxx b/Charts/Core/vtkAxis.cxx
index d2c86ee8e9..c23a3390c2 100644
--- a/Charts/Core/vtkAxis.cxx
+++ b/Charts/Core/vtkAxis.cxx
@@ -1267,6 +1267,13 @@ void vtkAxis::GenerateTickLabels(double min, double max)
     {
       double range = mult > 0.0 ? max - min : min - max;
       n = vtkContext2D::FloatToInt(range / this->TickInterval);
+      constexpr int maxTicks = 21;
+      // We need to bound the total number of ticks.
+      if(n > maxTicks) 
+      {
+         this->TickInterval = range / double(maxTicks);
+         n = vtkContext2D::FloatToInt(range / this->TickInterval);
+      }