How do I change Number of axis-ticks?

46 views
Skip to first unread message

Sandra Rum

unread,
Nov 10, 2017, 4:38:15 AM11/10/17
to pyqtgraph
Hello everyone,

I have a question considering the Axis.

In my plot, I have a height axis displaying meters. This axis may show 10000m or just 1m depending on the zoom level.
At the moment, the axis calculates the ticks automatically. However, sometimes a lot of ticks are displayed.

Now I want to customize the distances of the ticks (1m, 10m, 50m, 100m, ...) depending on the range, so that only 5-10 ticks are displayed.

Is there an easy way to implement that? And what is the best way to do it?

I already noticed http://www.pyqtgraph.org/documentation/graphicsItems/axisitem.html#pyqtgraph.AxisItem.setTickSpacing, but I am not sure, how to use it. Is there a good example available?

Best regards,
Sandra Rum

Reply all
Reply to author
Forward
0 new messages