matplotlib 3.5.1

NotesParametersReturnsBackRef
margins(*margins, x=None, y=None, tight=True)

The padding added to each limit of the Axes is the margin times the data interval. All input parameters must be floats within the range [0, 1]. Passing both positional and keyword arguments is invalid and will raise a TypeError. If no arguments (positional or otherwise) are provided, the current margins will remain in place and simply be returned.

Specifying any margin changes only the autoscaling; for example, if xmargin is not None, then xmargin times the X data interval will be added to each end of that interval before it is used in autoscaling.

Notes

If a previously used Axes method such as pcolor has set use_sticky_edges to :None:None:`True`, only the limits not set by the "sticky artists" will be modified. To force all of the margins to be set, set use_sticky_edges to :None:None:`False` before calling margins .

Parameters

*margins : float, optional

If a single positional argument is provided, it specifies both margins of the x-axis and y-axis limits. If two positional arguments are provided, they will be interpreted as xmargin, ymargin. If setting the margin on a single axis is desired, use the keyword arguments described below.

x, y : float, optional

Specific margin values for the x-axis and y-axis, respectively. These cannot be used with positional arguments, but can be used individually to alter on e.g., only the y-axis.

tight : bool or None, default: True

The tight parameter is passed to autoscale_view , which is executed after a margin is changed; the default here is True, on the assumption that when margins are specified, no additional padding to match tick marks is usually desired. Set tight to None will preserve the previous setting.

Returns

xmargin, ymargin : float

Set or retrieve autoscaling margins.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.signal._czt.CZT scipy.spatial._kdtree.KDTree.query_ball_point scipy.signal._filter_design.butter scipy.signal._filter_design.ellip scipy.signal._filter_design.cheby1 scipy.signal._waveforms.unit_impulse scipy.signal._filter_design.cheby2 scipy.signal._filter_design.gammatone scipy.signal._max_len_seq.max_len_seq scipy.signal._filter_design.bessel matplotlib.pyplot.plotting

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/pyplot.py#2682
type: <class 'function'>
Commit: