pyvista.plotting.charts.Axis.tick_count#

property Axis.tick_count[source]#

Return or set the number of ticks drawn on this axis.

Setting this property to a negative value or None will automatically determine the appropriate amount of ticks to draw.

Examples

Create a 2D chart with a reduced number of ticks on the x-axis.

>>> import pyvista as pv
>>> chart = pv.Chart2D()
>>> _ = chart.line([0, 1, 2], [2, 1, 3])
>>> chart.x_axis.tick_count = 5
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/a8a20ba12209927ad4977a2d412db747c92e04c2/28d3d/_images/pyvista-plotting-charts-axis-tick_count-2_00_00.png

Revert back to automatic tick behavior.

>>> chart.x_axis.tick_count = None
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/f46aa1528fc88fbfbde123eb6aa648cfb8c52a8b/71fb3/_images/pyvista-plotting-charts-axis-tick_count-2_01_00.png