matplotlib.axes.Axes.set_anchor#
- Axes.set_anchor(anchor,share=False)[source]#
Define the anchor location.
The actual drawing area (active position) of the Axes may be smallerthan the Bbox (original position) when a fixed aspect is required. Theanchor defines where the drawing area will be located within theavailable space.
- Parameters:
- anchor(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
Either an (x,y) pair of relative coordinates (0 is left orbottom, 1 is right or top), 'C' (center), or a cardinal direction('SW', southwest, is bottom left, etc.). str inputs are shorthandsfor (x,y) coordinates, as shown in the following diagram:
┌─────────────────┬─────────────────┬─────────────────┐│ 'NW' (0.0, 1.0) │ 'N' (0.5, 1.0) │ 'NE' (1.0, 1.0) │├─────────────────┼─────────────────┼─────────────────┤│ 'W' (0.0, 0.5) │ 'C' (0.5, 0.5) │ 'E' (1.0, 0.5) │├─────────────────┼─────────────────┼─────────────────┤│ 'SW' (0.0, 0.0) │ 'S' (0.5, 0.0) │ 'SE' (1.0, 0.0) │└─────────────────┴─────────────────┴─────────────────┘
- sharebool, default: False
If
True, apply the settings to all shared Axes.
See also
matplotlib.axes.Axes.set_aspectfor a description of aspect handling.
On this page