matplotlib.pyplot.
margins
(*margins, x=None, y=None, tight=True)[source]¶Set or retrieve autoscaling margins.
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.
Parameters: |
|
---|---|
Returns: |
|
Notes
If a previously used Axes method such as pcolor()
has set
use_sticky_edges
to 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 False
before calling margins()
.