MCPcopy
hub / github.com/matplotlib/matplotlib / set_xmargin

Method set_xmargin

lib/matplotlib/axes/_base.py:2857–2884  ·  view source on GitHub ↗

Set padding of X data limits prior to autoscaling. *m* times the data interval will be added to each end of that interval before it is used in autoscaling. If *m* is negative, this will clip the data range instead of expanding it. For example, if your data

(self, m)

Source from the content-addressed store, hash-verified

2855 return self._ymargin
2856
2857 def set_xmargin(self, m):
2858 """
2859 Set padding of X data limits prior to autoscaling.
2860
2861 *m* times the data interval will be added to each end of that interval
2862 before it is used in autoscaling. If *m* is negative, this will clip
2863 the data range instead of expanding it.
2864
2865 For example, if your data is in the range [0, 2], a margin of 0.1 will
2866 result in a range [-0.2, 2.2]; a margin of -0.1 will result in a range
2867 of [0.2, 1.8].
2868
2869 Parameters
2870 ----------
2871 m : float greater than -0.5
2872
2873 See Also
2874 --------
2875 :ref:`autoscale_margins`
2876 matplotlib.axes.Axes.margins
2877 matplotlib.axes.Axes.get_xmargin
2878
2879 """
2880 if m <= -0.5:
2881 raise ValueError("margin must be greater than -0.5")
2882 self._xmargin = m
2883 self._request_autoscale_view("x")
2884 self.stale = True
2885
2886 def set_ymargin(self, m):
2887 """

Callers 5

marginsMethod · 0.95
marginsMethod · 0.80
scatterMethod · 0.80
test_log_marginsFunction · 0.80
auto_ticks.pyFile · 0.80

Calls 1

Tested by 1

test_log_marginsFunction · 0.64