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

Method _scale_axis_limits

lib/mpl_toolkits/mplot3d/axes3d.py:1997–2022  ·  view source on GitHub ↗

Keeping the center of the x, y, and z data axes fixed, scale their limits by scale factors. A scale factor > 1 zooms out and a scale factor < 1 zooms in. For non-linear scales, the scaling happens in transformed coordinates to ensure uniform zoom behavior.

(self, scale_x, scale_y, scale_z)

Source from the content-addressed store, hash-verified

1995 self._scale_axis_limits(scale[0], scale[1], scale[2])
1996
1997 def _scale_axis_limits(self, scale_x, scale_y, scale_z):
1998 """
1999 Keeping the center of the x, y, and z data axes fixed, scale their
2000 limits by scale factors. A scale factor > 1 zooms out and a scale
2001 factor < 1 zooms in.
2002
2003 For non-linear scales, the scaling happens in transformed coordinates to ensure
2004 uniform zoom behavior.
2005
2006 Parameters
2007 ----------
2008 scale_x : float
2009 Scale factor for the x data axis.
2010 scale_y : float
2011 Scale factor for the y data axis.
2012 scale_z : float
2013 Scale factor for the z data axis.
2014 """
2015 # Get the axis centers and ranges in transformed coordinates
2016 cx, cy, cz, dx, dy, dz = self._get_w_centers_ranges()
2017
2018 # Compute new limits in transformed coordinates and set
2019 self._set_lims_from_transformed(
2020 cx - dx*scale_x/2, cx + dx*scale_x/2,
2021 cy - dy*scale_y/2, cy + dy*scale_y/2,
2022 cz - dz*scale_z/2, cz + dz*scale_z/2)
2023
2024 def _get_w_centers_ranges(self):
2025 """

Callers 2

_on_moveMethod · 0.95
_zoom_data_limitsMethod · 0.95

Calls 2

_get_w_centers_rangesMethod · 0.95

Tested by

no test coverage detected