MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_xbound

Method set_xbound

lib/matplotlib/axes/_base.py:3819–3851  ·  view source on GitHub ↗

Set the lower and upper numerical bounds of the x-axis. This method will honor axis inversion regardless of parameter order. It will not change the autoscaling setting (`.get_autoscalex_on()`). Parameters ---------- lower, upper : float or None

(self, lower=None, upper=None)

Source from the content-addressed store, hash-verified

3817 return right, left
3818
3819 def set_xbound(self, lower=None, upper=None):
3820 """
3821 Set the lower and upper numerical bounds of the x-axis.
3822
3823 This method will honor axis inversion regardless of parameter order.
3824 It will not change the autoscaling setting (`.get_autoscalex_on()`).
3825
3826 Parameters
3827 ----------
3828 lower, upper : float or None
3829 The lower and upper bounds. If *None*, the respective axis bound
3830 is not modified.
3831
3832 .. ACCEPTS: (lower: float, upper: float)
3833
3834 See Also
3835 --------
3836 get_xbound
3837 get_xlim, set_xlim
3838 invert_xaxis, xaxis_inverted
3839 """
3840 if upper is None and np.iterable(lower):
3841 lower, upper = lower
3842
3843 old_lower, old_upper = self.get_xbound()
3844 if lower is None:
3845 lower = old_lower
3846 if upper is None:
3847 upper = old_upper
3848
3849 self.set_xlim(sorted((lower, upper),
3850 reverse=bool(self.xaxis_inverted())),
3851 auto=None)
3852
3853 def get_xlim(self):
3854 """

Callers 4

apply_aspectMethod · 0.95
_set_view_from_bboxMethod · 0.95
test_set_xy_boundFunction · 0.45

Calls 2

get_xboundMethod · 0.95
set_xlimMethod · 0.95

Tested by 2

test_set_xy_boundFunction · 0.36