margin

property Axis.margin

Return or set the axis margin.

Examples

Create a 2D chart.

>>> import pyvista
>>> chart = pyvista.Chart2D()
>>> chart.background_color = 'c'
>>> _ = chart.line([0, 1, 2], [2, 1, 3])
>>> chart.show()
../../../../_images/pyvista-plotting-charts-Axis-margin-1_00_00.png

Manually specify a larger (bottom) margin for the x-axis and a larger (left) margin for the y-axis.

>>> chart.x_axis.margin = 50
>>> chart.y_axis.margin = 50
>>> chart.show()
../../../../_images/pyvista-plotting-charts-Axis-margin-1_01_00.png