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

Method _get_bounds_or_viewLim

lib/matplotlib/spines.py:235–250  ·  view source on GitHub ↗

Get the bounds of the spine. If self._bounds is None, return self.axes.viewLim.intervalx or self.axes.viewLim.intervaly based on self.spine_type

(self)

Source from the content-addressed store, hash-verified

233 self._position = None # clear position
234
235 def _get_bounds_or_viewLim(self):
236 """
237 Get the bounds of the spine.
238
239 If self._bounds is None, return self.axes.viewLim.intervalx
240 or self.axes.viewLim.intervaly based on self.spine_type
241 """
242 if self._bounds is not None:
243 low, high = self._bounds
244 elif self.spine_type in ('left', 'right'):
245 low, high = self.axes.viewLim.intervaly
246 elif self.spine_type in ('top', 'bottom'):
247 low, high = self.axes.viewLim.intervalx
248 else:
249 raise ValueError(f'spine_type: {self.spine_type} not supported')
250 return low, high
251
252 def _adjust_location(self):
253 """Automatically set spine bounds to the view interval."""

Callers 2

_adjust_locationMethod · 0.95
set_boundsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected