You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 2.1.1.post1088+gf4bcca3
Fork me on GitHub

This Page



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.


anchor : str or 2-tuple of floats

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’

See also

for a description of aspect handling.