log_scale

property Axis.log_scale

Flag denoting whether a log scale is used for this axis.

Note that setting this property to True will not guarantee that the log scale will be enabled. Verify whether activating the log scale succeeded by rereading this property.

Examples

Create a 2D chart.

>>> import pyvista
>>> chart = pyvista.Chart2D()
>>> _ = chart.line([0, 1, 2, 3, 4], [1e0, 1e1, 1e2, 1e3, 1e4])
>>> chart.show()
../../../../_images/pyvista-plotting-charts-Axis-log_scale-1_00_00.png

Try to enable the log scale on the y-axis.

>>> chart.y_axis.log_scale = True
>>> chart.show()
../../../../_images/pyvista-plotting-charts-Axis-log_scale-1_01_00.png
>>> chart.y_axis.log_scale
True