matplotlib.axes.Axes.set_anchor

Axes.set_anchor(anchor, share=False)

Define the anchor location.

The actual drawing area (active position) of the Axes may be smaller than the Bbox (original position) when a fixed aspect is required. The anchor defines where the drawing area will be located within the available space.

Parameters:
anchor : 2-tuple of floats or {'C', 'SW', 'S', 'SE', ...}

The anchor position may be either:

  • a sequence (cx, cy). cx and cy may range from 0 to 1, where 0 is left or bottom and 1 is right or top.
  • a string using cardinal directions as abbreviation:

    • 'C' for centered
    • 'S' (south) for bottom-center
    • 'SW' (south west) for bottom-left
    • etc.

    Here is an overview of the possible positions:

    'NW' 'N' 'NE'
    'W' 'C' 'E'
    'SW' 'S' 'SE'
share : bool, optional

If True, apply the settings to all shared Axes. Default is False.

See also

matplotlib.axes.Axes.set_aspect
for a description of aspect handling.

© 2012–2018 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.0.0/api/_as_gen/matplotlib.axes.Axes.set_anchor.html