It is not new; you can use plotItem.hideButtons()
(which I see is not documented.. I'll correct that)
That's correct, there is no setTickSpacing method. I suppose I could add one..
The important thing to understand is that when the AxisItem is deciding what ticks it should draw (given the min/max range values), it first consults its own tickSpacing method to determine what the major/minor spacings should be.
Here's a simple example of an AxisItem subclass that always has major ticks spaced 10 units apart and minor ticks spaced 1 unit apart:
class FixedAxisItem(pg.AxisItem):
def tickSpacing(self, minVal, maxVal, size):
return [(10, 0), (1, 0)]
This axis class could then be placed into a PlotItem exactly as shown in the custom plot example.
You could also pretty easily implement your own setTickSpacing with this:
class FixedAxisItem(pg.AxisItem):
def __init__(self, *args, **kwds):
self.spacing = [10, 1]
pg.AxisItem.__init__(self, *args, **kwds)
def setTickSpacing(self, *spacing):
self.spacing = spacing
def tickSpacing(self, minVal, maxVal, size):
return [(x, 0) for x in self.spacing]
Let me know if this doesn't make sense. I definitely recommend reading up on OOP as Qt inherently relies on it pretty heavily.
Luke