matplotlib tutorial (8) nitta@tsuda.ac.jp

Chapter 8: Axis specification (2)

8-1: Axis sharing (sharex, sharey)

WHen arranging multiple Axes objects, the axis scale labels may overlap. In such cases, the y-axis and x-axis scale labels can be shared for easy viewing.

8-2: Share axes row / column (sharex='row' or 'col', sharey='row' or 'col')

Sharing an axis between axes with different axis scales causes the problem that one of them is displayed smaller because the larger axis is adopted. In such a case, the sharing range of the axis is limited.

8-3: Control scaling of the axis (axis, set_aspect)

When plotting a graph, it is drawn in the specified area, so it may be displayed vertically or horizontally even if the x-axis and y-axis scale are the same. There is a method to display the x-axis and y-axis on the same scale.

8-4: Change axis scaling (set_yscale, set_xscale)

The x-axis and y-axis scaling is 'linear' by default, but you can change this to 'log', 'semilog', 'symlog', 'logit', and so on.

Try changing to logarithmic scaling.

8-5: Set different scale axes to the left and right of the coordinate system (Axes), using Axes.twinx

You may want to draw two data of different scales and compare them with each other. In this case, place an additional y-axis (Axes object) of a different scale on the opposite side (right).